4 ms·
So you've moved the IF statement that was checking the logging level from the program code into the JIT. Great. No saving. (And I doubt it actually does this -
by nbevans 5y ago
So you've moved the IF statement that was checking the logging level from the program code into the JIT. Great. No saving. (And I doubt it actually does this - as it's not gaining anything)
- molyss 5y agoYou didn’t move the IF. you literally removed it. If (a) DoExpensiveStuff()); Becomes When modifyA() RecompileIfWithNewAValue(); As long as you call the initial if more often than you modify (a), you’re fine (and the JVM was able to see that you called your if 10k times without modifying the value of (a) even once)
- ludamad 5y agoRespectfully, your post is very wrong :) JIT compilers are very fast and run once to prep the code that will run many times. If you had flat code that was always run exactly once the games would be lesser, yes