Subj : Re: GCJ + Rhino To : Andy Madigan From : Igor Bukanov Date : Wed Aug 25 2004 09:05 pm Igor Bukanov wrote: > Andy Madigan wrote: > >> I've been trying to use GCJ to compile Rhino natively (so that, for >> instance, a natively compiled app could expose Java APIs to a script, >> which would be useful for many purposes.) I've had a few problems thus >> far: >> 1: org.mozilla.javascript.classfile.ClassFileWriter cannot be compiled, >> however, I was able to compile a shared object anyway by removing any >> classes that referenced to ClassFileWriter directly. > > > What is exactly the problem there? Does GCJ crash? AFAIK gcc was able to > compile Rhino as is. You are right, GCJ does crash with Rhino sources. But it was simple to work around and I committed to Rhino CVS the necessary changes, see http://bugzilla.mozilla.org/show_bug.cgi?id=256865 . But with compilation problems fixed Rhino executable has no problems with any JS optimization level and it confirmed that Java bytecode execution with GCJ is not the fastest around. When Rhino was compiled via gcj -O2, its pure interpretation mode was faster by 15-20% then JVM bytecode mode with all optimizations on with benchmarks from http://lxr.mozilla.org/mozilla/source/js/benchmarks. The same benchmarks when run with SpiderMonkey run 3 times faster then GCJ-ed Rhino and when I used jdk 1.4.2 and run Rhino with all bytecode optimizations on it was slower then SpiederMonkey by 35% => 2 times faster then GCJ. Regards, Igor .