Caldarale, Charles R wrote:
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.
And probably not worth the effort right now unless somebody is just curious or doing some deep research. I've already got an order-of-magnitude improvement in my implementation of this piece of code, and more than that on the servlet's overall performance. As a result, right now I don't have any way of generating enough load to find a bottleneck in the overall servlet (which is a very good thing!!). I've got several machines sitting around that I'd probably have to configure as a client farm if I'm going to generate significant loads on this app now.

D



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to