Switch vs if ?

Laurent Bourgès bourges.laurent at gmail.com
Tue Jan 16 09:41:10 UTC 2018


Hi,

I ask you as you are the hotspot & jvm performance experts.

Do you know if hotspot prefers if over switch on integer values (profiling
hotspots) ?

Is it worth to order integer cases with higher probability first or not ?

How to optimize such if cascades ?

Cheers,
Laurent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20180116/defbf5b1/attachment.html>


More information about the hotspot-compiler-dev mailing list