Warming up a loop

Hello

I was reading the

FAQ About the Java HotSpot VM

and I camed up this Q&A

Should I warm up my loops first so that Hotspot will compile them?

Warming up loops for HotSpot is not necessary. HotSpot contains On Stack Replacement technology which will compile a running (interpreted) method and replace it while it is still running in a loop. No need to waste your applications time warming up seemingly infinite (or very long running) loops in order to get better application performance.

What is warming up a loop?

cheers,

Ehsan

[628 byte] By [Ehsan.Sa] at [2007-11-27 7:59:10]
# 1

The way I understand it, the HotSpot system interprets Java byte code at first, but when it discovers that a specific method is used a lot, it compiles that method into native code, which runs faster, but the compilation takes time, which is why it wasn't done from the outset.

"Warming up", I guess, would be running a method so long that the system thinks it's used enough to warrant compiling, so that it gets compiled and runs faster in the future.

HTH

OleVVa at 2007-7-12 19:41:12 > top of Java-index,Java Essentials,Java Programming...
# 2
or running it long enough that all the hardware caches are primed ...
ejpa at 2007-7-12 19:41:12 > top of Java-index,Java Essentials,Java Programming...
# 3
cool
tom_jansena at 2007-7-12 19:41:12 > top of Java-index,Java Essentials,Java Programming...