File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jit vs. interpreter

 
vijay kumar
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic