.NET FrameworkJIT compiler


JIT compilation, or just-in-time compilation, is an alternative approach to interpretation of code or ahead-of-time compilation. JIT compilation is used in the .NET framework. The CLR code (C#, F#, Visual Basic, etc.) is first compiled into something called Interpreted Language, or IL. This is lower level code that is closer to machine code, but is not platform specific. Rather, at runtime, this code is compiled into machine code for the relevant system.


Why use JIT compilation?

  • Better compatibility: each CLR language needs only one compiler to IL, and this IL can run on any platform on which it can be converted into machine code.
  • Speed: JIT compilation attempts to combine the speed of running ahead-of-time compiled code, and the flexibility of interpretation (can analyze code that will be executed for potential optimizations before compiling)

Wikipedia Page for more information on JIT compilation in general: https://en.wikipedia.org/wiki/Just-in-time_compilation