If you want something you never had do something which you had never done
apigee, a better way to API!
If you want something you never had do something which you had never done
RaviNada Kiran wrote:
One more doubt is that whether all this (inlining of final methods) will be done at compile time or at runtime ??
Nitesh Kant wrote:This is one of the many optimizations that a compiler does behind the scenes.
[List of FAQs] | [Android FAQ] | [Samuh Varta]
If you want something you never had do something which you had never done
Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer
Tim Holloway wrote:
..
In older JVMs there were performance advantages to declaring a class final. They supposedly no longer apply, but some classes are final for other reasons.
suppose the compiler looks at class A and subclass B, and sub-subclass C and sees a final method in A which it inlines into C. But then at runtime the versions loaded for A and B are different and the method is not final in A, and overridden in B. Then C uses the incorrectly inlined version.
Adam Michalik wrote:the javac compiler does not inline anything (does not do what Nitesh Kant wrote)
Tim Holloway wrote:In older JVMs there were performance advantages to declaring a class final. They supposedly no longer apply, but some classes are final for other reasons. For example, Java.lang.String. It keeps people from getting too creative by subclassing core classes and overriding critical functionality.
Gaurav Arora wrote:
Tim Holloway wrote:
..
In older JVMs there were performance advantages to declaring a class final. They supposedly no longer apply, but some classes are final for other reasons.
I wonder if thats actually true. I'd appreciate it if you could present an article or something. I have read that very statement on a few different sites but have never found anyone who is able to cite his sources.
[List of FAQs] | [Android FAQ] | [Samuh Varta]
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |