aspose file tools*
The moose likes Performance and the fly likes JIT Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Performance
Bookmark "JIT" Watch "JIT" New topic
Author

JIT

Joanne Fire
Ranch Hand

Joined: Nov 22, 2001
Posts: 33
By using JIT, will I compile as fast as C++? If I understand correctly, we still have another step to do compared to the C++ complier. My question would be, how would compiling it on the fly/dynamically make it faster than without the JIT?
Brian Daniel
Greenhorn

Joined: Oct 30, 2001
Posts: 11
The Hotspot JIT calculates on the fly which bits of code are to be used more frequently and only spends time compiling those, the rest of the one-hit-wonder pieces of code are interpreted still.
Mark Herschberg
Sheriff

Joined: Dec 04, 2000
Posts: 6037
Will it compile as fast as C++? I don't know, I've never heard of any tests of compilers. In terms of run time performence, they will be comporable in most cases (your specific milage may vary).
Remember that most byte code is interpreted. The byte codes is run by the JVM. JVM actions are performed by a sequence of native instruction calls (i.e. OS/chipset calls). When a set of calls get compiled directly to native code, that set runs faster, b/c you removed a level of indirection (it's somewhat analogous to inlining a method call). Of course, there is an up front performence penalty for doing the actual compilation.
Note that most JITs run in two modes, client and server, to reflect the different behavioral patterns of each type of application.

--Mark
Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
One thing that limits Java performance, compared to something like C, is its greater run-time checking of operations. For instance, Java always checks for attempts to read/write off the end of an array or String. C compilers typically either do not check or, depending how the code is written, cannot check such things. Thus the Java is potentially more stable, and certainly easier to debug, but the C has the potential to be faster.


Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Originally posted by Peter Chase:
One thing that limits Java performance, compared to something like C, is its greater run-time checking of operations. For instance, Java always checks for attempts to read/write off the end of an array or String. C compilers typically either do not check or, depending how the code is written, cannot check such things. Thus the Java is potentially more stable, and certainly easier to debug, but the C has the potential to be faster.

On the other hand, the hot spot engine may remove these checks, if it analyzes that they aren't necessary. In fact, the dynamic optimization at runtime performed by the hotspot engine can lead to better performance in some areas as the static optimization of other compilers would be capable of.


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Joanne Fire
Ranch Hand

Joined: Nov 22, 2001
Posts: 33
I thank you all, Brian, Mark, Ilja, Peter for your input, all these explanations really allowed me to understand this more clearly, you are all great! Thank you!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JIT
 
Similar Threads
Error Message
SilverStream and JVM
jit vs. interpreter
Tech Word Game
Is JDK same for all platforms(windows,unix,mac) or is it different for different operating systems.