• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Warmup code

 
Rajdeep Biswas
Ranch Hand
Posts: 216
1
Eclipse IDE Java Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15216
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic