Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #36534

Re: Generics and downcasts

From Eric Sosman <esosman@comcast-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Generics and downcasts
Date 2017-04-25 18:13 -0400
Organization A noiseless patient Spider
Message-ID <odohfm$i47$1@dont-email.me> (permalink)
References <generics-20170424231405@ram.dialup.fu-berlin.de> <odoaaj$9q$1@gwaiyur.mb-net.net> <odob39$s00$1@gioia.aioe.org> <odoc85$5b4$1@gwaiyur.mb-net.net>

Show all headers | View raw


On 4/25/2017 4:40 PM, Marcel Mueller wrote:
> On 25.04.17 22.20, Arne Vajhøj wrote:
>> [Marcel Mueller also wrote; attribution lost:]
>>> There are other pitfalls that are by far more expensive.
>>> E.g. if you miss to declare a trivial Java method as final. This
>>> prevents the JIT from inlining the method body. This may add an overhead
>>> of an order of magnitude or even more.
>>
>> I think this is a myth.
>>
>> https://www.ibm.com/developerworks/library/j-jtp1029/  (Brian Goetz 2002)
>> [...]
> 
> I never said that the Java compiler might inline such function calls. 
> This is up to the JIT.

     The JIT is able to inline non-final and non-private methods.  Here's
a page with some information on how you can watch it happening:

https://techblug.wordpress.com/2013/08/19/java-jit-compiler-inlining/

-- 
esosman@comcast-dot-net.invalid
Thirteen hundred sixty-six days to go.

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Generics and downcasts Marcel Mueller <news.5.maazl@spamgourmet.org> - 2017-04-25 22:07 +0200
  Re: Generics and downcasts Arne Vajhøj <arne@vajhoej.dk> - 2017-04-25 16:20 -0400
    Re: Generics and downcasts Eric Douglas <e.d.programmer@gmail.com> - 2017-04-25 13:35 -0700
      Re: Generics and downcasts Arne Vajhøj <arne@vajhoej.dk> - 2017-04-25 19:54 -0400
    Re: Generics and downcasts Marcel Mueller <news.5.maazl@spamgourmet.org> - 2017-04-25 22:40 +0200
      Re: Generics and downcasts Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-04-25 18:13 -0400
      Re: Generics and downcasts Arne Vajhøj <arne@vajhoej.dk> - 2017-04-25 19:53 -0400

csiph-web