Inspired by this question,
Now visible only for users with > 10k rep
I came up with the following code:
$cat loop.c
int main(
My guess is that the JIT is optimizing away the empty loop.
Update: The Java Performance Tuning article Followup to Empty Loop Benchmark seems to support that, along with the other answers here that point out that the C code needs to also be optimized in order to make a meaningful comparison. Key quote:
Had I chosen to use the client mode 1.4.1 JVM (client is the default mode), the loops would not be optimized away. Had I chosen to use Microsoft's C++ compiler, the C version would take no time. Clearly, the choice of compiler is critical.