I am currently investigating a strange behaviour in one of our performance tests: In this test I am executing a pretty complex calculation several times. The test is showing some ramp-up behaviour. The first run is the most expensive run after that about 100 runs execution time is 1000-5000ns and after this it drops to 10-40ns. As the test uses randomly generated values, I modified the test to generate the data once and then execute the test with exactly the same data.
In order to elminiate classloading and other issues, I even executed the run once and added a sleep of one second to give any background stuff the chance to finish loading classes and other stuff.
I would have expected a similar execution time throughout the runs and could understand a decrease of performance due to garbage collection kicking in ... but seeing the runs getting faster and faster seems rather odd.
I can't really explain this behaviour. Are there any effects in the VM that could be doing some sort of optimization?
Chris