© 2012 Autodesk
CLR Execution Model
VB
Source code
C++
C#
Operating System Services
Common Language Runtime
Native Code
Managed
Code
(dll or exe)
Compiler
Assembly
IL Code
Assembly
IL Code
Assembly
IL Code
vbc.exe
cc.exe
csc.exe
JIT Compiler
•The diagram above illustrates the process used to compile and execute managed code, that is, code that uses the CLR.
•Source code written in C#, VB.NET, or some other language that targets the CLR is first transformed into MSIL by the appropriate language compiler.
•Before execution, this MSIL is JIT compiled into native code for whatever processor the code will run on.
•The default is to JIT compile each method when it is first called, but it’s also possible to “pre-JIT” the MSIL. With this option, all methods are compiled before the application is loaded, so the overhead of JIT compilation on each initial method call is avoided.
•One point worth noting is that all languages targeting the CLR should exhibit roughly the same performance. While some compilers may produce better MSIL code than others, large variations in execution speed are unlikely.