Wednesday 15 September 2010

performance - Ramp up time of Java VM? -


I am currently checking a strange behavior in any of our demonstration tests: in this trial I have a lot of times I am performing complex calculations. Testing shows some ramp-up behaviors The first run is the most expensive runs, after which the execution time of approximately 100 runs is 1000-5000 and after that it goes for 10-40 points. As the test uses randomly generated values, I modified the test data once and then performed the test with the same data.

To eliminate the classing and other issues, I once executed the run and added one second sleep to give any background material an opportunity to finish loading classes and other materials. > I was expecting the time of equal execution in the whole run, and due to kick in the garbage collection, performance could be reduced ... but the runs seem to be getting faster and faster but it looks strange.

I really understand this behavior: Does VM have any effect which is doing some kind of adaptation?

Chris

This effect is caused by hotspot.

The hotspot executes the runtime of the byte code.

Earlier it interprets the byte code. It is very slow.

If the hotspot detects that the code is executed on a regular basis, then it compiles the code on the native code on the computer that executes the code. It gives the first improvement in the speed of execution.

After the hotspot is still analyzing your code. If it is often called (your program has hot spots) the hotspot will optimize your code. This is done more often when it is determined Does that mean that your code is running often and takes longer to execute. Optimization is more aggressive.

So often code is executed and will take longer and will be more customized and if your code is adaptable then it will be able to optimize as much as possible.

> A white paper can be found for this.

No comments:

Post a Comment