When is the Jitting performed?

  • Thread starter Thread starter codymanix
  • Start date Start date
C

codymanix

When the app started the first time, or every time I run the app? If yes, is
all the code Jitted by once or are only relevant parts of the code jitted?
If the first applies, is the resulting native code stored somewhere?

I heard different people saying very different things so I'm not sure what
to believe.
 
No, JITing is done as each method is called. Uncalled methods are not Jited.
The IL in the called method is JITed and then the native CPU instructions
are stored (Cached) in memory. See Richter page 15 "Applied Microsoft .NET
Framework Programming" for a picture and a blow by blow description. You can
also use NGEN to "pre-compile" an entire assembly but then the entire
assembly takes up storage on disk even if you use 1% of it as well as other
drawbacks.
 
Back
Top