HotSpot optimization list

As of 2010, HotSpot supported optimizations:
moved here:

Intrinsic methods as of trunk 20120523
moved here:

Cool list.

I’d like to add scalar replacement (since ~2008) which depends on escape analysis (see Found it amazingly effective in the context of typical 3d math (detail in my blog entry

I’d really like to see more articles testing the effectiveness and limitations of those optimizations (e.g. range check elimination, inlining).

As for devirtualization I found two nice articles:

I would like to see the list of dalvik runtime optimizations too. Altought it would be short.

There are none to speak of - Dalvik is a fork of JamVM. The only thing it really does beyond interpreting is basic JITting.

Cas :slight_smile:

Well looking at that list. Implementing something as fast as the sun JVM is now is a pretty daunting task. Even for Google.

And for mobile devices.

Is Dalvik really a fork of JamVM or does it just use some JamVM code? Is JamVM even register-based?

I know that the Dalvik ‘bytecode’ uses registers for most operations, instead of the stack.

(but maybe you already implied that in your question)

It’s not just about using registers to execute stack-machine bytecode, since existing JVMs do that as well. Dalvik actually runs a completely different set of bytecode that specifies a virtual register machine instead of a stack machine. In other words, it’s basically not a JVM at all, though it does map rather easily and completely from one.

That’s what I said :-*

Allegedly the source code for the Dalvik VM even has the comments in some files copied verbatim from JamVM. I’ve not bothered to check, myself.

Cas :slight_smile:

Hotspots is pretty damn nice these days especially after they finally added the long discussed tiered compilation.

Probably the last big discussed optimisation that they are missing is HotSpot SIMD operations.

Prognosis a little shaky since all the brains are leaving. I imagine some new talent will fill the gaps eventually though.

Cas :slight_smile:

Added semi-current list of intrinsic functions to initial post.

WRT: inlining…the last time I looked it was very aggressive but I believe this is one of those things that will vary significantly with each update (not JDK 7 -> JDK 8 kinda thing, but each public release).

The size/depth of the inlining can be tuned with a -XX:MaxInlineSize parameter. I expect various programs will vary slightly in performance depending on what value this gets set to.

Cas :slight_smile: