I have a Java app which is packaged up using JarBundler. The app is fairly CPU intensive (lots of big Collection.sort() calls).
On Mac OS, the app runs slow and sluggish when using the 64-bit JavaApplicationStub. This JavaApplicationStub file is launching the Java 64-bit VM.
I found an old JavaApplicationStub file which is 32-bit only. I replaced it in the Bundle, and the app runs 10x faster! (consequently, the 32-bit VM is utilized when the application runs).
Does this make any sense? Why is the 64-bit VM so much slower? Does it make sense to build an app and hack the JavaApplicationStub file like this?
Advise is appreciated.
See this post on the benefits/disadvantages of running a 64bit JVM. In summary pointer dereferencing & memory de-allocation can take longer - and you are moving around larger data-structures (i.e. 64, not 32 bit, which serves you no advantage to you unless you are explicity making use of them).
Also see this relevant article, where they discuss decreases in performance of up to 85% when moving to 64bit, which is in-line with what you are experiencing: