0

I'm making a several performance tests of different languages. When I started test Java applications I got a problem: JIT Compiler. I noted that after several executions of a method, this method increase your performance significantly, so I discovered that it use JIT Compiler. To make my tests I've two options.

  1. Activate manually JIT, or
  2. Check if it is activated.

I must do it to get the real results about methods executions.

Augusto
  • 3,825
  • 9
  • 45
  • 93
  • 2
    It's more complicated than that. See https://stackoverflow.com/questions/504103/how-do-i-write-a-correct-micro-benchmark-in-java but it's a really bad idea to try to benchmark things without a good understanding on what happens. You're bound to get it wrong, then your benchmarks aren't trustworthy. – Kayaman Oct 30 '19 at 19:26
  • 1
    *I must do it to get the real results about methods executions* disabling JIT will make _anything_, but that. – Eugene Oct 30 '19 at 19:26
  • 1
    `JMH` is a great suggestion how to test those methods, [here](https://stackoverflow.com/a/55601399/1059372) is an extensive example with how to disabled some JIT steps... – Eugene Oct 30 '19 at 19:29
  • *real results* about methods executions? But defining/measuring the computation time of a function is certainly not as so easy as you may think, there is a lot of layers that may interfer (OS & HW caches, JIT, prefetchs, etc) – Jean-Baptiste Yunès Oct 30 '19 at 19:36

0 Answers0