harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Will Glass-Husain" <wgl...@forio.com>
Subject JVM performance article
Date Fri, 03 Jun 2005 17:17:09 GMT
Hi,

As a lurker on this list, I thought I'd share the following article:

http://www.osnews.com/story.php?news_id=10729

This might be a good article for those new to JVMs.  It's not as technical 
as the various white paper citations being bandied about but it's a nice 
introduction to just-in-time-compiling / optimization, Swing threading, and 
other JVM performance-related issues.

"I think Java is somehow still seen as an interpreted language; in fact, it 
does get compiled to native code using Just In Time (JIT) compilation. It is 
also a myth to think that JIT code is slower than pre-compiled code. The 
only difference is that bytecode gets JITed once its required (i.e., the 
first time a method is called - and the time is negligible) it then gets 
cached for subsequent calls. JIT code can benefit from all the same 
optimisations that pre-compiled can get, plus some more (from Lewis and 
Neumann, 2004):

* The compiler knows what processor it is running on, and can generate code 
specifically for that processor. It knows whether (for example) the 
processor is a PIII or P4, if SSE2 is present, and how big the caches are. A 
pre-compiler on the other hand has to target the least-common-denominator 
processor, at least in the case of commercial software.

* Because the compiler knows which classes are actually loaded and being 
called, it knows which methods can be de-virtualized and inlined. 
(Remarkably, modern Java compilers also know how to "uncompile" inlined 
calls in the case where an overriding method is loaded after the JIT 
compilation happens.)

* A dynamic compiler may also get the branch prediction hints right more 
often than a static compiler."

I assume these will all be goals for a Harmony project JVM?

Best,
WILL


Mime
View raw message