Tier Compilation

A while back (a few years?), progress on tiered compilation was going well until the main engineer died along with any further news or progress on it.

However looks like there been a recent patch to JDK7 that now adds this.

http://weblogs.java.net/blog/forax/archive/2010/09/04/tiered-compilation

from the looks of the benchmark there its almost twice as fast as the client JIT. Now that’s an impressive speed boost.

It’s been in for ages - I’ve been using it for months now, I got a fairly hefty boost in speed with Revenge of the Titans, which is mainly limited by array/buffer access checks in Java 6, and possibly float operations.
The server VM in Java 7 has some seriously good bounds check hoisting in it finally but because the server VM was so miserably slow and juddery at starting up I’d never used it before for games but finally the tiered thing works and works well. Of course, it’s actually more useful on the low-end machines than the high-end ones.

Cas :slight_smile:

oh cool, didn’t know about that!

are you using java7 or somehow using it on java 6 with some parameter?

Java 7. Eclipse debug cmdline for Revenge at the moment:


-server -XX:+TieredCompilation -XX:Tier2CompileThreshold=150000 -XX:CompileThreshold=1500 -Djava.library.path=${workspace_loc:LWJGL/native/windows} -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -Xmx128m -XX:MaxGCPauseMillis=10 -XX:+UseAdaptiveSizePolicy -verbose:gc -ea -Dorg.lwjgl.util.NoChecks=true

Cas :slight_smile:

Awesome, thx for sharing. Hopefully by they Java 7 release they’ll have ironed it all out and enabled Tiered Compilation by default.

Looks like Java has all the big pieces that people have theorised about for years, with Escape Analysis, G1 and Tiered Compilation we should have some super awesome speeds.

Guess that just leaves Hotspot SIMD operations.

The JSR 166y deals about it, doesn’t it? Hotspot is supposed to turn your code into SIMD calls for you.

ForkJoin is about spreading the load over multiple threads.

I can’t find anything about SIMD in JSR166y…

yup same here.

SSE (Streaming SIMD Extensions) is already supported at the JVM level since Java 1.4.2 even without the JSR 166y, look at the flag “UseSSE” in the server JVM:

[quote]-XX:UseSSE=0 // FPU only, don’t use SSE -XX:UseSSE=1 // FPU + SSE -XX:UseSSE=2 // SSE + SSE2
[/quote]

HotSpot does operations on single floats in SSE, not true SIMD (single instruction multiple data)

Where did you read that?

Interwebs. Just google it.

At least 3 RFEs, dead in the water:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6604786
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6559557
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6340864

I check the hotspot code recently (what I believe is the most recent release) for Riven’s perlin noise thread and there’s no SIMD generation.

Interesting article, posted today:


From the screenshots it’s pretty obvious that the events are SCALAR not PACKED.