Timo said:
I don't think much of that article -- anyone reading it would come away with
the impression that there was only one JVM, that its implementation was set in
stone, and that it did no optimisation. None of these things are even
approximately true.
There may be a good case to be made for an optimising javac for generating
bytecodes for PDAs etc (at least for as long as their space limitations are
significant). But the case for optimisation in javac for normal apps is far
less clear. The arguments against it are that
(a) it makes the "hotspot" (and similar) optimisations in the JVM harder
(to be honest, I don't know whether this is *really* a problem -- it's
something you often hear asserted, and it sounds plausible, but I've never seen
an authoritative reference).
(b) it means that the compiler is harder to write, takes longer to add
features, is much harder to make *correct*, and is only doing optimisations
that the runtime may be, or is, doing anyway.
E.g. why would Sun put effort into optimisations in javac that duplicate what
their hotspot technology is doing ? There may be people compiling code with
Sun's javac, that then run it on JVMs without optimisation. Optimisations in
javac would be beneficial to *them*, but why should Sun (or indeed anyone else)
care much about them ?
If you can quantify the benefit you expect to get from an optimising javac,
then you'll be in a position to decide how much time/money/effort you are
willing to put into finding one. So it comes back to the question that Mark
asked:
What benefit are you expecting to get from optimised bytecode?
This is a serious suggestion: if this is important to you, then try
hand-optimising the generated bytecodes for a few realistic sample cases, then
run the optimised and non-optimised versions on a modern JVM (Sun's 'server'
JVM would be my choice) and see how much difference it really makes. My guess
is it will make very little difference, perhaps even have a negative effect,
but that *is* only a guess, and I may well be wrong. In any case I'd be
interested to hear the result.
-- chris