An interesting question! I have no experience with GCJ at all; but I
would be surprised if GCJ was not able to dynamically load classes at
runtime -- all it would need, I'd imagine, would be precompiled
binaries of every class it could conceivably need. But maybe someone
with more experience here could speak up.
That being said, last I was keeping up with things, HotSpot was often
significantly faster than GCJ (!!). Have matters changed? Just
because bytecode is compiled at runtime rather than compile-time
doesn't mean that the runtime machine code would be slower; indeed,
because HotSpot is doing things at runtime it can determine what parts
of the code would _really_ benefit from heavy optimization, and GCJ
cannot tell this (it only can do static analysis). Though one thing
you can do in GCJ is remove array bounds checks, which is dangerous but
no doubt would result in faster code.
On Jun 3, 2004, at 2:27 PM, Mike Eggleston wrote:
> Though ecj is fast, my objective function is not. I'd like to
> run the objective function at machine speed rather than jvm
> speed. Has there been any attempts, any luck, at compiling
> ecj with gcj into a binary? Seems that this wouldn't work
> because of the dynamic loading that ecj does for problems,
> statistics, function sets, etc.