when will the JIT run?
-
C#'s compiled result is a exe in CLR code. it said required JIT run. does it mean compile to native code once software is deployed? or compile each time we used it? will it be a burden when we develop a fairly big application?
The JIT compiles each method as it is executed for the first time while running. This is why startup time for a .NET program is so long. You can get rid of the JIT by performing an install time JIT,
ngen <assembly>
will pre-JIT the code. There is no guarantee the code won't be JITted again later. However I think it is a safe bet that won't happen since a reason to JIT is when the underlying IL has changed or it has been requested (usually for the above reason). HTH, James Sonork ID: 100.11138 - Hasaki "Smile your little smile, take some tea with me awhile. And every day we'll turn another page. Behind our glass we'll sit and look at our ever-open book, One brown mouse sitting in a cage." "One Brown Mouse" from Heavy Horses, Jethro Tull 1978 -
The JIT compiles each method as it is executed for the first time while running. This is why startup time for a .NET program is so long. You can get rid of the JIT by performing an install time JIT,
ngen <assembly>
will pre-JIT the code. There is no guarantee the code won't be JITted again later. However I think it is a safe bet that won't happen since a reason to JIT is when the underlying IL has changed or it has been requested (usually for the above reason). HTH, James Sonork ID: 100.11138 - Hasaki "Smile your little smile, take some tea with me awhile. And every day we'll turn another page. Behind our glass we'll sit and look at our ever-open book, One brown mouse sitting in a cage." "One Brown Mouse" from Heavy Horses, Jethro Tull 1978