Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
.Net code is compiled into IL but at runtime is converted into Native Code. if the entire program is converted into native code or just those pieces that are required? Which part of the framework is responsible for this?
Posted
Comments
Patrice T 27-Aug-15 3:21am    
Please, do not repost same question.

 
Share this answer
 
The program is generally JIT-compiled on per-method basis. The method is compiled when it is needed for a call. Once a IL method is compiled, it's native code remains in memory for the rest of runtime. This way, a method which is never called may be never compiled. See also: https://en.wikipedia.org/wiki/Just-in-time_compilation[^].

By the way, it's important to take into account if you try to measure performance by timing some fragment of call. In such measurements, it's important to exclude JIT phase. It's easy to do if you make sure that each of the method which can be called during timing is called at least once before timing.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900