Forums Register Login

JIT

+Pie Number of slices to send: Send
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?
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
 

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.
+Pie Number of slices to send: Send
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 yam what I yam and that's all that I yam - the great philosopher Popeye. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 898 times.
Similar Threads
SilverStream and JVM
Error Message
Is JDK same for all platforms(windows,unix,mac) or is it different for different operating systems.
Tech Word Game
jit vs. interpreter
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 00:47:22.