473,382 Members | 1,431 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

JIT Question

Hi

How does JIT compilers work? Does they first compile the *entire*
bytecode into machine code and then starts execution? Or they first
compile a method, execute that and then compile another method and
execute that and so on. Why it is called as "Just In Time"?

Interpreters also need to compile to bytecode before execution. Thus
whether a java bytecode is executed by interpreter or JIT compiler,
the compilation will be required in the both the cases. Then why does
JIT compilers are slower then interpreters in certain cases?
Also does the current JVMs (JDK 1.3 and 1.4) supports JIT? Which JVM
versions supports JIT?

Does HotSpot VM supports JIT?

thanks,
Naresh
Jul 17 '05 #1
6 5249

"Naresh Agarwal" <na******@informatica.com> wrote in message
news:2b*************************@posting.google.co m...
Hi

How does JIT compilers work? Does they first compile the *entire*
bytecode into machine code and then starts execution? Or they first
compile a method, execute that and then compile another method and
execute that and so on. Why it is called as "Just In Time"?

Interpreters also need to compile to bytecode before execution. Thus
whether a java bytecode is executed by interpreter or JIT compiler,
the compilation will be required in the both the cases. Then why does
JIT compilers are slower then interpreters in certain cases?
Also does the current JVMs (JDK 1.3 and 1.4) supports JIT? Which JVM
versions supports JIT?

Does HotSpot VM supports JIT?

thanks,
Naresh


(response cross-posted to c.l.j.a)

Interpreters must parse sourcecode/bytecode but do not neccessarily
"compile" it. Even if they do the compilation outcome can be some abstract
instruction set not matching any processor hardware (that would be called
something like bytecode).

The Sun JIT starts executing bytecodes directly and builds a statistical
analysis of which code gets executed how often. As soon as it decides some
code is up for JIT-ting it is compiled to native machine code to be executed
faster from that point on.

Personally I would have preferred precompilation of a complete class file as
soon as it is loaded. That is what I call JIT. The way it works now in my
opinion should not be called JIT but JTL instead (Just Too Late, obviously).

People at Sun are so charmed by the concept they came up with once that they
blindly cling to it. The simpler precompilation (backup up by a smart JVM
level caching scheme would be an enormous performance boost. They insist
that more efficient compilation/optimization is possible when runtime
characteristics are know (as they are during JTL compilation) but that is
bullshit. This delivers a marginal advantage over preanalysis that can never
make up for the time lost with a) interpreting code initially b) time spent
during compiling at runtime c) time lost because of not being able to cache.
The memory-use argument is silly except for j2me.

Understand me correctly: I love Java and think it is one of the best
software development of the past ten years. I agree that static compilation
is not an option but I think the .NET precompilation scheme is much simpler
and more efficient. The Java JIT scheme is only better in mostly academic
perspectives and unfortunately gives us a performance disadvantage in
comparison with .NET.

Now I mentioned .NET: I have been a long time Win32 developer (C++ from
about '92) and gradually shifted to Java about four years ago. Did not look
back until some .NET projects came up that needed resqueing. Looked at .NET
(Winforms, ADO.NET and ASP.NET) and was absolutely disgusted. .NET is gross.

Just my ?0.02,

Regards,

Silvio Bierman
Jul 17 '05 #2
On Thu, 8 Jan 2004 11:30:53 +0100, "Silvio Bierman"
<sb******@idfix.nl> wrote or quoted :
The simpler precompilation (


If you want that use a native compiler. See
http://mindprod.com/jgloss/nativecompiler.html

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
Jul 17 '05 #3

"Roedy Green" <lo**********************************@mindprod.com > wrote in
message news:13********************************@4ax.com...
On Thu, 8 Jan 2004 11:30:53 +0100, "Silvio Bierman"
<sb******@idfix.nl> wrote or quoted :
The simpler precompilation (


If you want that use a native compiler. See
http://mindprod.com/jgloss/nativecompiler.html

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.


No, I dont want a native compiler. I want slightly different behaviour from
the Sun JRE. Mark suggested there are options for precompilation but that is
not true for the Sun JREs, maybe for IBMs JRE but that is not up to date
enough (had serious problem with using that with JIT enabled anyway).

JIT compilation is absolutely fine. I would just like to be able to ensure
no code ever is interpreted but always compiled-on-load, even as
fine-grained as the method level is OK with me. Backup up by a good caching
scheme this is more than efficient enough to not want native compilers
producing platform binaries. Look at .NET, this is about the only thing they
got right (slightly exaggerating here, off course).

Regards,

Silvio Bierman
Jul 17 '05 #4
Silvio Bierman wrote:
"Roedy Green" <lo**********************************@mindprod.com > wrote in
message news:13********************************@4ax.com...
On Thu, 8 Jan 2004 11:30:53 +0100, "Silvio Bierman"
<sb******@idfix.nl> wrote or quoted :

The simpler precompilation (


If you want that use a native compiler. See
http://mindprod.com/jgloss/nativecompiler.html

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.

No, I dont want a native compiler. I want slightly different behaviour from
the Sun JRE. Mark suggested there are options for precompilation but that is
not true for the Sun JREs, maybe for IBMs JRE but that is not up to date
enough (had serious problem with using that with JIT enabled anyway).


I believe the options do exist on the Sun JRE, the problem is finding
documentation.
http://java.sun.com/docs/hotspot/VMOptions.html

Try the -XX:CompileThreshold option

Mark Thornton

Jul 17 '05 #5
"Mark Thornton" <ma*************@ntl-spam-world.com> wrote in message
news:tD*************@newsfep4-winn.server.ntli.net...
I believe the options do exist on the Sun JRE, the problem is finding
documentation.
http://java.sun.com/docs/hotspot/VMOptions.html

Try the -XX:CompileThreshold option

Mark Thornton


I may have misread the description for the -XBatch command switch but it
might precompile fully. maybe.

from
http://java.sun.com/j2se/1.4.1/docs/...inux/java.html
Jul 17 '05 #6
Nick Howes wrote:
"Mark Thornton" <ma*************@ntl-spam-world.com> wrote in message
news:tD*************@newsfep4-winn.server.ntli.net...
I believe the options do exist on the Sun JRE, the problem is finding
documentation.
http://java.sun.com/docs/hotspot/VMOptions.html

Try the -XX:CompileThreshold option

Mark Thornton

I may have misread the description for the -XBatch command switch but it
might precompile fully. maybe.

from
http://java.sun.com/j2se/1.4.1/docs/...inux/java.html


I interpret that as meaning that it still uses the interpreter to start
with, but when it decides a method is worth compiling the compilation is
done directly. The normal mode means that the application continues
using the interpreted (or previous compiled code) until the new
compilation is ready.
In any case if you don't like how the Sun JVM does it, you can always
try an alternative JVM such as those from IBM.

Mark Thornton

Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mohammed Mazid | last post by:
Can anyone please help me on how to move to the next and previous question? Here is a snippet of my code: Private Sub cmdNext_Click() End Sub Private Sub cmdPrevious_Click() showrecord
3
by: Stevey | last post by:
I have the following XML file... <?xml version="1.0"?> <animals> <animal> <name>Tiger</name> <questions> <question index="0">true</question> <question index="1">true</question> </questions>
7
by: nospam | last post by:
Ok, 3rd or is it the 4th time I have asked this question on Partial Types, so, since it seems to me that Partial Types is still in the design or development stages at Microsoft, I am going to ask...
3
by: Ekqvist Marko | last post by:
Hi, I have one Access database table including questions and answers. Now I need to give answer id automatically to questionID column. But I don't know how it is best (fastest) to do? table...
10
by: glenn | last post by:
I am use to programming in php and the way session and post vars are past from fields on one page through to the post page automatically where I can get to their values easily to write to a...
10
by: Rider | last post by:
Hi, simple(?) question about asp.net configuration.. I've installed ASP.NET 2.0 QuickStart Sample successfully. But, When I'm first start application the follow message shown. ========= Server...
53
by: Jeff | last post by:
In the function below, can size ever be 0 (zero)? char *clc_strdup(const char * CLC_RESTRICT s) { size_t size; char *p; clc_assert_not_null(clc_strdup, s); size = strlen(s) + 1;
56
by: spibou | last post by:
In the statement "a *= expression" is expression assumed to be parenthesized ? For example if I write "a *= b+c" is this the same as "a = a * (b+c)" or "a = a * b+c" ?
2
by: Allan Ebdrup | last post by:
Hi, I'm trying to render a Matrix question in my ASP.Net 2.0 page, A matrix question is a question where you have several options that can all be rated according to several possible ratings (from...
3
by: Zhang Weiwu | last post by:
Hello! I wrote this: ..required-question p:after { content: "*"; } Corresponding HTML: <div class="required-question"><p>Question Text</p><input /></div> <div...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.