RFR(XS): JDK-8010941: MinJumpTableSize is set to 18, investigate if that's still optimal

Niclas Adlertz niclas.adlertz at oracle.com
Tue May 21 05:51:45 PDT 2013

Hi all.

MinJumpTableSize is 18 and was set many years ago. This is probably no longer optimal, performance investigations is needed to see what a good new value is.

Using the performance test http://cr.openjdk.java.net/~adlertz/JDK-8010941/Test.java  (based on: http://stackoverflow.com/questions/15621083/why-does-java-switch-on-ordinal-ints-appear-to-run-faster-with-added-cases) I look at the results using MinJumpTableSize=18 and MinJumpTableSize=0. 
If MinJumpTableSize=0 gives a better result, I divide the cases in the switch-case inside multiply_by_power_of_ten() by half giving me Y number of cases (and adjust rand.nextInt(Y) accordingly), and try again. 
This is repeated until I find a number of cases X showing that MinJumpTableSize=18 is better. Then I look for a breakpoint in between X and Y that gives me the optimal MinJumpTableSize.

The test shows that the optimal MinJumpTableSize on: 
SPARCV9 (Solaris) is 5 
x64 (Linux) is 6

WEBREV: http://cr.openjdk.java.net/~adlertz/JDK-8010941/webrev00/
JBS: https://jbs.oracle.com/bugs/browse/JDK-8010941

A review would be much appreciated. 
Thank you.

Niclas Adlertz

More information about the hotspot-compiler-dev mailing list