aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Holly Cummins <>
Subject Re: Another weaving problem?
Date Fri, 03 Jun 2011 14:14:01 GMT
Kevan wrote:
> On Jun 2, 2011, at 6:39 PM, Alasdair Nottingham wrote:
> > Is that claim about final methods true of all JVMs do you know? I 
> know different JVMs tend to have different JITs so I was wondering 
> if they are talking about just the hotspur JVM?
> I've asked some JVM types to see if I can find any data on this. Is 
> there any evidence that a 'final method' makes a difference on any 
> Initial general advice I've gotten back (which would fit with my 
> general outlook on the subject) was: don't write code for JIT 
> optimization until warranted and well understood... Hopefully, I'll 
> hear back on some specifics of JIT behavior. 

I'd concur with this. I think a few years ago, adding final modifiers to 
methods was a reasonable optimisation, because it avoided the expenses of 
virtual methods. Now, (at least some) JITs will assume methods aren't 
virtual (when they're not overridden), and then dynamically detect 
overloading and go through a de-compile un-unline re-compile loop if the 
situation changes. So a non-overridden non-final method will have the same 
performance as a final method. 

JITs are pretty smart things and they tend to be optimised for the most 
popular development practices, rather than the 'cleverest' code. 


Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message