Saturday, May 10, 2008

Just-in-Time [JIT]

JIT compiler is a crucial component of the .NET framework. The JIT compiler converts IL to machine code, which is then executed. The JIT compiler does not compile the entire code at once because it could hamper the performance of the program. It compiles the code at runtime, at the time it is called. The code that is compiled gets stored until the execution comes to an end. This avoids recompilation of code.

Types of JIT
There following three types of JIT:
Pre-JIT
It compiles whole source code into native code in a single compilation cycle. This is done at the time of deployment of the application
Econo-JIT
It compiles only those methods that are called at runtime. However, these methods are removed when they are not required.
Normal-JIT
It also compiles only those methods which are called at runtime. These methods are compiled the first time they are called, and then they are stored in cache. When the same methods are called again, the compiled code from cache is used for execution

No comments:

Post a Comment