The Source for Java Technology Collaboration
User: Password:



Rémi Forax

Rémi Forax's Blog

JSR 277 and ahead of time compilation

Posted by forax on October 19, 2006 at 07:27 AM | Comments (4)

Last week, an early draft of Java Module System (JSR277) was published. To sum up, this draft defines :

  1. the concept of exportable module, which is closed to OSGi bundle or eclipse plugin.
  2. the way modules are packaged, as super jar named Java Archive Module (or jam).
  3. and how modules are store in a local repository.

One short paragraph at the end of the section 12 of the chapter 7, the one about module repository, awakes my geek instinct. I quote:

 This deployment step offers the repository implementation an
 opportunity to transform a module definition into a more efficient
 format for run time access. For instance,
 [...]
 Native code can be generated for the frequently used classes in a
 module definition to optimize runtime performance.

Let me try to explain what is the idea behind : when a module is stored in the local repository, the code is automatically transformed in native code by performing a static analysis on the bytecode. This technique is called Ahead of Time compilation and is, at least, used today by Excelsior JET runtime environment. Then when the VM try to execute a class of this module, the native code is used for the first runs before the hotspot detection that performs a runtime analysis provide a better code.

Oh, oh, will we see in a near future, more VMs providing a module repository implementing ahead of time compilation ? And thus VMs that never interpret bytecodes !

Rémi Forax


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • I don't want a VM that never executes bytecodes. I feel confident that Java would run a whole lot slower if everything was pre-compiled.

    Posted by: keithkml on October 19, 2006 at 01:05 PM

  • Kool, then java application can have better performance , before JIT gathers enought information.

    Posted by: fcmmok on October 19, 2006 at 01:44 PM

  • nice. any idea how it relates to the gcj-db native code lookup facility?

    Posted by: robilad on October 20, 2006 at 05:37 AM

  • I dont see it happening for our applications own classes, but it would be interesting if it could pre-complile the JRE classes. So you download and install bytecode classes only. Once you start running apps, it starts compiling JRE classes, and keeps them in a database somewhere so the compiled versions get reused. Then the more you run a JVM, the faster your apps get!

    Posted by: benloud on October 22, 2006 at 08:22 AM





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds