IT Community - Software Programming, Web Development and Technical Support

VMs with JIT Compilers

This is a discussion on VMs with JIT Compilers within the C and C++ Programming forums, part of the Software Development category; VMs with JIT Compilers : The basic bytecode interpreter VM executes by decoding and executing bytecodes. This is slow,and is ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C and C++ Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 11-03-2007, 05:32 AM
ragavraj ragavraj is offline
D-Web Programmer
 
Join Date: Feb 2007
Posts: 92
ragavraj is on a distinguished road
Default VMs with JIT Compilers

VMs with JIT Compilers :
The basic bytecode interpreter VM executes by decoding and executing bytecodes. This is slow,and is pure overhead, adding nothing to the functionality of the application. A just-in-time ( JIT)compiler in a virtual machine eliminates much of this overhead by doing the bytecode fetch and
decode just once. The first time the method is loaded, the decoded instructions are converted intomachine code native for the CPU the system is running on. After that, future invocations of aparticular method no longer incur the interpreter overhead. However, a JIT must be fast atcompiling to avoid slowing the runtime, so extensive optimizations within the compile phase areunlikely. This means that the compiled code is often not as fast as it could be. A JIT also imposes asignificantly larger memory footprint to the process.

Without a JIT, you might have to optimize your bytecodes for a particular platform. Optimizing the bytecode for one platform can conceivably make that code run slower on another platform (though a speedup is usually reflected to some extent on all platforms). A JIT compiler can theoretically
optimize the same code differently for different underlying CPUs, thus getting the best of all worlds.

In tests by Mark Roulo (Accelerate your Java apps! - Java World), he found that a good JIT speeded up the overhead of method calls from a best of 280 CPU clock cycles in the fastest non-JIT VM, to just 2 clock cycles in the JIT VM. In a direct comparison of method
call times for this JIT VM compared to a compiled C++ program, the Java method call time was found to be just one clock cycle slower than the C++: fast enough for almost any application.

However, object creation is not speeded up by anywhere near this amount, which means that with a JIT VM, object creation is relatively more expensive (and consequently more important when tuning) than with a non-JIT VM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 08:53 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0