This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes jit vs. interpreter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "jit vs. interpreter" Watch "jit vs. interpreter" New topic
Author

jit vs. interpreter

vijay kumar
Greenhorn

Joined: Nov 16, 2000
Posts: 14
hi guys,
while reading basic tool doc for java under windows following lines stumped me. Would some kind soul enlighten me on the following.
1.When a class is loaded, the JIT translates the class bytecodes into native machine code. Using a JIT causes a slight delay after each class load, but can improve overall program performance. In some cases, execution time will improve by a factor of ten.
my comment: ok
2.If the JIT is disabled, bytecodes are executed directly by an interpreter.
my comment: hey wait a minute,a.first which interpreter? and b. does mean that there was no interpreter being used when we use jit? c. what exactly is this jit
i thought jit was interpreter, interpreting bytecode in form of .class files and generating the native executable
thanks in advance
vijay
vijay kumar
Greenhorn

Joined: Nov 16, 2000
Posts: 14
Lemme answer myself, its all about compilation technology.remember java is set of rules and anyone who follows that can make the tool and not just sun
There r two stages of compilation
1. Convert java source to byte code
one tool is javac.exe as obtained from sun. there very few others who make similar tools coz this job is burdensome and with few rewards, coz it doesn't benefit many.
2.convert byte code to native code
initially we had what we called interpreters, which r basically compilers but they were kind of slow.
so they got jit compilers which is an extension to earlier technology. basic tenet is 20% of the methods get called 80% time so why waste time compiling all. so methods are compiled when they are needed and native executable code is generated accordingly.
many companies have jit compilers and there is money here coz the reward is being able to produce code that runs faster.

3. now how the heck it affects we developer
a. decide on which jit compiler to use
b. decide when to turn jit on or off. thumb rule is if there is lopsided usage of some methods go for jit.
though i think u still need to see some literature coz am no expert on this.
so here is one link http://www.bearcave.com/software/java/comp_java.html
regards
vijay
Originally posted by vijay kumar:
hi guys,
while reading basic tool doc for java under windows following lines stumped me. Would some kind soul enlighten me on the following.
1.When a class is loaded, the JIT translates the class bytecodes into native machine code. Using a JIT causes a slight delay after each class load, but can improve overall program performance. In some cases, execution time will improve by a factor of ten.
my comment: ok
2.If the JIT is disabled, bytecodes are executed directly by an interpreter.
my comment: hey wait a minute,a.first which interpreter? and b. does mean that there was no interpreter being used when we use jit? c. what exactly is this jit
i thought jit was interpreter, interpreting bytecode in form of .class files and generating the native executable
thanks in advance
vijay

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jit vs. interpreter
 
Similar Threads
JVM Server Mode vs Client Mode
What does JIT compiler do ?
JVM and JIT
JIT Question
waht role of JIT in JVM