Groups | Blog | Home
all groups > dotnet framework > february 2006 >

dotnet framework : Is the output of JIT cached ?


Nick Hounsome
2/27/2006 2:10:28 PM

[quoted text, click to view]

JIT = Just In Time so only those bits actaully called will be compiled.

[quoted text, click to view]

I don't know what it does but there is no need for it to generate code twice
for the same IL just because it is loaded into two different appdomains.

chak
2/27/2006 6:46:20 PM
These may be a very basic question.

1) Is IL compiled to native code every time a application is invoked ?

2) If a process has multiple appdomains (i think each instance of an
application maps to an appdomain), if one application is closed will the
appdomain close ? If the same application is then re-invoked will it use the
JIT-ted code generated last time , or will it again JIT ?

Regards,

Chak.


Alan J. McFarlane
2/27/2006 8:45:51 PM
[quoted text, click to view]
Have a read of this article,
http://msdn.microsoft.com/msdnmag/issues/05/04/NGen/default.aspx
--
Alan J. McFarlane
http://www.alanjmcf.me.uk/
Please follow-up in the newsgroup for the benefit of all.
chak
2/28/2006 12:00:00 AM
Thanks. The article referred to by you states :

"As you know, the just-in-time (JIT) compiler is used for compiling the
Microsoft intermediate language (MSIL) code in a .NET assembly into native
code for the local machine immediately before the code is executed. This is
temporary code; it is created and stored in the running processes's memory
space, which is reclaimed by the OS when the process dies. Thus, it will be
regenerated each time a new process needs it."

So i think it answers my question to the effect that even if two different
people accessed the same application seperately, from 2 different PC's, it
would create 2 instances of that application in 2 different application
domains of the respective local machines , by JIT compiling it twice (one
for each instance). Is my understanding right ?

Thanks.


[quoted text, click to view]

Nick Hounsome
2/28/2006 12:54:30 PM
You are answering a different question to the one that you originaly posed:

Yes you are right that if 2 people access an app from 2 machines then it
will get JIT'd twice i.e. it's not like python - where it compiles to a .pyc
file in the same directory [actually that's not an exact analogy because
python is doing the equivalent of C# -> MSIL rather than MSIL -> obj but
hopefully you get the point]

What you originaly asked was whether it would compile twice if you loaded
the same assembly into 2 app domains in the same process (necessarily on the
same machine) and there is no reason for it to do so.


[quoted text, click to view]

AddThis Social Bookmark Button