News for hackers. Stuff that matters.
Re:Logging Performance Comparison by j16sdiz on Sunday July 10, 2022 @10:44PM (#32051600)
In many C/C++ optimizing compiler, this is replaced with `counter = 1000;`.

I have no idea how java handle this.. Does the AOT compiler do any optimization? Would this defer to the JIT?

Re:Logging Performance Comparison by thfuran on Sunday July 10, 2022 @10:58PM (#32051687)
There is aot native compilation in javaland these days, but I assume you mean javac, the compiler that transforms source into jvm bytecode. It defers pretty much all optimization to the JITs and won't remove empty loops.
Re:Logging Performance Comparison by pwagland on Monday July 11, 2022 @07:48AM (#32054852)
No, but in this case, the JIT will get rid of this empty loop.