• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

jit vs. interpreter

 
Greenhorn
Posts: 14
  • 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
  • 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


 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic