I am trying to benchmark a JVM running on various hardware and OS platforms. I have created an algorithm to implement the parts of the JVM that interest me, and I intend to run this algorithm repeatedly to find a decent average.
When I run the test, I find that the first run is much longer than subsequent runs:
132ms 86ms 77ms 89ms 72ms
My suspicion is that classes load lazily, putting a lot of overhead on first run. Although this is indeed a feature that I believe is unique to every JVM, I'm not interested in that.
Is there a standard command line option or property for actively loading classes? or does anyone have other theories?
java
Cogsy
source share