Skip to main content

any clues what JIT does here?

1 reply [Last post]
schubige
Offline
Joined: 2005-10-24
Points: 0

When I run the code below on my machine [Java(TM) SE Runtime Environment (build 1.6.0_21-b07) Java HotSpot(TM) 64-Bit Server VM (build 17.0-b17, mixed mode)] I get the following results:

PerfTest$ArrayWrapperMember: 2.7199286254281643 GB/sec
PerfTest$ArrayWrapperNewObject: 1.3608410585952058 GB/sec
PerfTest$ArrayWrapperPrintln: 0.5864497103657389 GB/sec

Has anyone ideas/explanations why the performance is affected considerably (more than factor 5) by the code in the branch of the "if(alwaysFalse)" of the "add" method which is NEVER executed? register allocation?, CPU pipeline?, speculative execution? JIT code?

----
PerfTest.java:

http://people.ee.ethz.ch/~simschub/PerfTest.java

Message was edited by: schubige

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
linuxhippy
Offline
Joined: 2004-01-07
Points: 0

My guess is because of the increased method size less inlining happens which causes more agressive optimizations not to happen. However just a guess.

- Clemens