I tried compiling ahead of time with Excelsior JET

My goal was to protect my source code, not to speed up my program. But naturally I played with it to see how speed was affected.

Some of the parts of my program were improved by the compilation. My UI, which mixes Swing and JOGL, was MUCH faster in some ways--I have a button that toggles simulation and that also switches between sets of OpenGL settings, and after the compilation by JET, I could rattle at this button with hardly any visible delay. With an Eclipse compilation and the standard JRE, popping the button up causes a delay of about half a second. Also, the JET version of the program initialized faster--the Eclipse/JRE version takes about a second to draw all its button icons and lay out the buttons and stuff, but again, under JET there was hardly any delay. And finally, the JET version didn't have to grind at my hard drive to load classes upon their first uses the way the Eclipse/JRE version does. Impressive!

But the parts of my program that most heavily use the CPU were not improved so much, and some of the most important ones were even slowed. And in particular, the time used by JBox2D to simulate seems to have increased by (very roughly) 75%. Some things I've written from scratch, without any major optimization, were also slowed.

Memory usage changed: The JET version of my program churned through memory alarmingly fast, but then would reach some threshold and quietly throw away most of what it had used, only to churn back up again. This made me a little suspicious, but it didn't seem to be hurting anything. (I know it's similar to what Java normally does, but I'm not used to seeing it happen so rapidly!)

All in all, Excelsior JET seems to be an excellent product. It was amazingly easy to use! And it didn't speed up my physics simulation.


I also tried GCJ, but that effort fell apart because GCJ is a mess.
Thank you for the kind words about our product! We would very much like to identify and eliminate the root cause of the slowdowns you have experienced. In fact, it may be something very simple like a misconfiguration. If you have not reported those issues to our engineering team, I kindly ask you to do so now. Please email java at excelsior-usa.com.

Just in case, there are free licenses available to non-commercial projects, e.g. we have just sponsored an open-source flight simulator.

Dmitry Leskov
Director of Marketing
Excelsior LLC
I figured it was just that JBox2D has been designed to be fast on the standard JRE, and that some of its most delicate optimizations don't translate easily to another platform. But of course the engineers behind the compiler for the other platform would prefer to think of this as a problem to be solved, rather than accepting it fatalistically as I have done. 🙂 And yeah, I only tested casually, with two configurations out of the many possible configurations one could use, and with only one physics scene.

I'll try to make up a little test program, simulating a large group of bodies with JBox2D, that works more slowly as an Excelsior JET program than as a Java program running on the standard JRE.
Keep in mind that the svn version is much more optimized
Yeah, that's what I use.

Original thread: https://box2d.org/forum/viewtopic.php?t=5019