> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
> Subject: Re: Performance: switch vs if ... else if
> 
> If you find that a tableswitch is /not/ being generated,

The tableswitch is being generated for the enum switch (rtFields), but not the 
char switch.  However, using the enum generates a ton of other invokes that 
will far outweigh any advantage of the tableswitch.  It's possible the JIT is 
optimizing much of that away, but it's hard to tell without seeing the 
generated native code (a tricky thing to dig out).

It's also possible the JIT could reorder the char switch into an indexed jump 
table even when javac doesn't, but again we'd need to see the native code to be 
sure. 

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

Reply via email to