any clues what JIT does here?
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?
Message was edited by: schubige