JIT(Just In Time) Compiler in .NET
JIT(Just In Time) Compiler in .NET
As we know that .Net Framework supports various Microsoft .Net Languages and all them use a Common Language Runtime rather than using a separate runtime for single one of languages. So, when .NET Common Language is installed in a computer it can support any language that is Microsoft .NET compatible. So, the purpose of JIT Compiler is to convert the .NET Language into the native code which is CPU specific. First the source code is converted to Intermediate Language by the language specific compiler which is further converted to the machine code by the JIT compiler.
Working of JIT Compiler:
JIT Types:
There are three types of JIT compilers and they are:
Pre-JIT Compiler: Compiles the entire code completely into native code in a single compilation cycle during the deployment of application. This compilation process is implemented at application deployment time.
Econo JIT Compiler: Compiles code segment by segment when called and the unnecessary compiled methods are removed.
Normal JIT Compiler: Only compiles the segment of code when called which is placed in cache. When the same methods are called again the code stored in the cache is used for execution.
Benefits of JIT Compiler:
-Requires less memory usage as only the methods that are required during the compile time are compiled into machine code.
-Code optimization can be performed by the JIT compiler while the code is running.
-Page faults are reduced as the chance of having the methods required together are most probably in the same memory page.
Also Read:
.NET 5: One Framework, All Platforms and Open Source
Facts about DataScience everyone should know