Remembering the benchmarks in the thread http://www.java-gaming.org/forums/index.php?topic=15659.0, I decided to do a test with the Sega Y-Board driver in JEmu2. I converted the zooming sprite and layer rotation emulation to use sun.misc.Unsafe to avoid array bounds checks and hopefully get a nice performance boost like the benchmarks showed was possible.
This part of the Y-Board emulator is the main bottleneck, and there’s HUGE amounts of random array access in there so this seemed a good real life test.
Since using this internal class requires a really ugly hack, I thought I’d post the results, because I found that in the end it’s not worth the trouble.
I got a performance boost which is hardly noticable (less than 5%) and when I use the server VM (latest 1.6), it actually seems counter productive (using normal arrays was actually a tiny bit faster than sun.misc.Unsafe, strange but true).
So, save yourself the trouble of using a kind of dangerous, non-standard class, just stick to normal arrays (or buffers if needed).