Peculiar fruits in the JDK

David M. Lloyd david.lloyd at redhat.com
Wed Jun 25 16:49:34 UTC 2008


On 06/25/2008 11:33 AM, Ulf Zibis wrote:
> Hi David,
> 
> please don't CC to me. Otherwise I get your message twice. I read the list.

Every poster on every list seems to have their own preference :-)  It would 
help if there were proper Reply-To: headers in messages from the mailing list.

> Internally this will be compiled as a looong if () else if () else if () 
> .... chain, because the cases are NOT consecutive. Executing such a 
> chain will never be faster, than calculating the index as I posted.

You mean in the JITed machine code?  In bytecode it should compile to a 
compact lookupswitch, but I admit I'm not familiar with how that would work 
on the JIT side.

- DML



More information about the core-libs-dev mailing list