>> My understanding is that on some platforms like AIX they can change
>> java from being an interpreter to running binaries through some
[quoted text clipped - 6 lines]
> But it will almost certainly be slower (do you think Java is JIT compiled
> because it's a fun thing to do?)
Actually yes - at least I do.
I believe that the purpose of bytecode is to be compatible between systems -
to be a standard. If JIT compiled code were always faster, or even usually
faster as you seem to be implying there would be no native compilation
systems out there. C++ would be made to compile to program to be used by a
virtual machine, to improve performance!!
You can say JIT is sometimes faster, negligibly slower,
--
LTP
:)
Oliver Wong - 22 Dec 2005 18:38 GMT
> I believe that the purpose of bytecode is to be compatible between
> systems - to be a standard. If JIT compiled code were always faster, or
> even usually faster as you seem to be implying there would be no native
> compilation systems out there. C++ would be made to compile to program to
> be used by a virtual machine, to improve performance!!
C++ is somewhat of a special case, because it's an older language and
yet remains in use in practice. That it is older means the language itself
suffers from problems we are now able to solve more elegantly in language
design theory (like avoiding ambiguity and keeping the grammar context
free), and so there is low academic interest in it (i.e. not much high-level
research being done for it). The fact that it's still in use in practice
means that a lot of low-level research in optimizing it has been done by
people in the industry.
I think we're hitting the limits of our capabilities to optimize C++,
while we still have lots of research to be done in optimizing higher level
languages.
Actually, Java might be hitting some limits too. There is some effort to
come up with a new intermediate representation for Java (i.e. something
other than bytecode). One contender is called "Jimple", which is a variant
on the representation known as "SIMPLE" with some Java-specific tweaks.
Jimple is believed to be more easy to optimize than bytecode.
Check out SOOT (http://www.sable.mcgill.ca/soot/), which is an
optimization framework which takes a .class file, converts it to Jimple
format, does some optimizations to it, and converts it back to .class file
(actually, to be more correct, it supports 4 different intermediate
representations; not just Jimple). Ideally, you'd want to keep it in Jimple
format, and run your JIT against the Jimple code instead of bytecode.
- Oliver
Alun Harford - 24 Dec 2005 03:14 GMT
>>> My understanding is that on some platforms like AIX they can change
>>> java from being an interpreter to running binaries through some
[quoted text clipped - 14 lines]
> compilation systems out there. C++ would be made to compile to program to
> be used by a virtual machine, to improve performance!!
Get a compiler that takes Java and compiles it into any machine language you
want. Compile a few Java programs you use, and then tell us whether they're
faster, or slower, than the Sun JVM.
(they'll be slower)
Alun Harford