New VM performance improvements

Hi guys,
Sorry for being away for so long, but I’ve been busy fixing bugs. Anyway I added another new intrinsic for the next version of Java. Absolute value (Math.abs) is now intrinsified to use hardware when available. For non-sse machines that means using FABS while sse machines use andpd or andps (depending on single or double precision). Client also picks up this improvement along with Server, SPARC, AMD64 and IA64 all have hardware implementations so those benefit as well. I’m open for suggestions to other improvements that might help.

No suggestions, but a quick thank-you for keeping us informed of this.

Sooner or later we tend to notice these things in the bug-fixed lists for later VM’s, but it’s great to get a heads-up on the stuff that matters, rather than have to manually trawl through hundreds of bugs to see what’s happening :slight_smile:

Could you explain what the mysterious two-tier compilation & threshold -XX flags are in the server VM…?

Cas :slight_smile:

Sure, those flags sorta kinda work. It was the first attempt at tiered compilation. Don’t use it, well you can if you want it just won’t help. Wait for the next version of Java, it’ll have working tiered compilation and all my math goodies.

[quote]Sure, those flags sorta kinda work. It was the first attempt at tiered compilation. Don’t use it, well you can if you want it just won’t help. Wait for the next version of Java, it’ll have working tiered compilation and all my math goodies.
[/quote]
Is there any possible hint on when/if regular snapshots of 6.0 will be available, like for beta3 of Tiger?

Dunno about the previews, we may or may not have them. If I find out, I’ll let you all know

Oh JOY! I think I moaned about the need for tiered compilation most vociferously in here, what, maybe four years ago or something! And finally we know it’s being started on.

At this rate we’ll see Structs by the end of the decade :smiley:

Cas :slight_smile:

Excuse my ignorance, but what is “tiered compilation”? ???

Tiered compilation is an extension of what HotSpot already does. So lets step back and talk about how HotSpot and most JIT compilers work in general. There are two phases in HotSpot, Interpreted and Compiled. When you start up a Java program, HotSpot first interprets the code until a certain threshold is reached (1000 for Client, 10,000 for Server) then the method is compiled and the compiled version is used (faster than interpreted, usually ALOT faster). Tiered compilation basically adds a second layer, so that you have interpreted -> fast jit, but low quality code -> slow jit but awesome code. Tiered compilation gives you the best of both worlds in that you get fast startup and good long running performance. Hope this helps…

hmmm. that includes merging of compilers? Will it use heueristics or command line switches to kick in? And memory consumption will be higher, I suppose?

All of that is unkown at this time, although memory consumption shouldn’t be higher. Since the JIT’s memory usage (C-HEAP) is significantly lower than the Java Heap. So I don’t expect a memory increase, but more info will be available once the work is nearing completion.

thanks, really great news. Now, when tiered compilation is covered, I hope escape analisys is next :wink:

Is this going to be added to 5.1 or 6.0?

Definitly 6.0 or later…

I don’t suppose you’d care to champion Structs with me?

Cas :slight_smile:

[quote]Tiered compilation is an extension of what HotSpot already does. So lets step back and talk about how HotSpot and most JIT compilers work in general. There are two phases in HotSpot, Interpreted and Compiled. When you start up a Java program, HotSpot first interprets the code until a certain threshold is reached (1000 for Client, 10,000 for Server)
[/quote]
Isn’t it 1,500 for client? Or is the -XX:CompileThreshold default for client on this page out of date:
http://java.sun.com/docs/hotspot/VMOptions.html

[quote]then the method is compiled and the compiled version is used (faster than interpreted, usually ALOT faster). Tiered compilation basically adds a second layer, so that you have interpreted -> fast jit, but low quality code -> slow jit but awesome code. Tiered compilation gives you the best of both worlds in that you get fast startup and good long running performance. Hope this helps…
[/quote]
I’ll understand if it is too early to say, but - would this be server VM only…? Or would client and server effectively merge with the new model…?

Whoops, its 1500 for X86 and 1000 for SPARC :slight_smile: I’m just so use to vieweing sparc files, that I didn’t notice the discrepency :slight_smile:

Thanks a lot for the info, Azeem !
Any insight about the previous ‘new jvm improvements’ topic and the bit shift/masking bench?

[quote]Thanks a lot for the info, Azeem !
Any insight about the previous ‘new jvm improvements’ topic and the bit shift/masking bench?
[/quote]
Well I’m working on JumpTables and I might be able to use SSE3 for some thing. My ultimate goal though, is to be able to use SSE to do SIMD. It would only help a limited set of code, and you’d have to write the code to a very narrow range, but I think I can figure out something. Stay tuned.

ps. Anyone have any good SSE documents?

For sure !!