I heard a lot about how compiling JIT makes code work faster than precompiling when it comes to "long-running" applications. But how long does it take to fully optimize your application?
Just for fun, I'll show you an example. I have some method, let me call it mySlowMethod() . It performs some matrix calculations, such as rotation, multiplication, etc. A few hundred times per second. I measured the time of each call and got the following results:
long time = System.nanoTime(); mySlowMethod(); System.out.println(System.nanoTime()-time); //first call 1577187 (1.6 ms) //next 2 seconds ~60000 (0.06 ms) //later less than 10000 (0.01 ms)
source share