aspose file tools*
The moose likes Java in General and the fly likes Warmup code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Warmup code" Watch "Warmup code" New topic
Author

Warmup code

Rajdeep Biswas
Ranch Hand

Joined: Mar 26, 2012
Posts: 186

Hi, I want to run a few performance tests. So I need guidance on how to add warmup code for JVM, so that the warming up of JVM has no effect on the benchmark test results.
Thank you


The biggest gamble will be to ask a question whose answer you know in that it will challenge your theory | www.TechAspire.blogspot.in
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14272
    
  21

Writing good performance benchmark code in Java is very hard because of the many sophisticated optimizations that the JVM and the JIT do and because of garbage collection, which happens at unpredictable times.

Some links:
Java theory and practice: Dynamic compilation and performance measurement
Java theory and practice: Anatomy of a flawed microbenchmark

Don't take the results of any micro-benchmark too seriously. Your real, production code might just behave and optimize slightly differently and have different performance characteristics than what you saw in your micro-benchmark.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Warmup code