Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Just-In-Time (JIT) Compiler in C#
WhatsApp
Mahesh Alle
Jun 03
130.7k
0
6
100
Article
Just-In-Time (JIT) Compiler in C#
The JIT compiler translates the MSIL code of an assembly to native code and uses the CPU architecture of the target machine to execute a .NET application.
It also stores the resulting native code so that it is accessible for subsequent calls.
If a code executing on a target machine calls a non-native method, the JIT compiler converts the MSIL of that method into native code.
The JIT compiler also enforces type safety in the runtime environment of the .NET Framework.
It checks for the values that are passed to the parameters of any method.
The following are the various types of JIT compilation in .NET:
Pre - JIT.
Econo - JIT.
Normal - JIT.
Pre - JIT
In Pre-JIT compilation, complete source code is converted into native code in a single cycle (i.e. compiles the entire code into native code in one stretch)
This is done at the time of application deployment.
In .Net it is called "Ngen.exe"
Econo - JIT
In Econo-JIT compilation, the compiler compiles only those methods that are called at run time.
After the execution of this method, the compiled methods are removed from memory.
Normal - JIT
In Normal-JIT compilation, the compiler compiles only those methods that are called at run time.
After executing this method, compiled methods are stored in a memory cache.
No further calls to compiled methods will execute the methods from the memory cache.
Just-In-Time JIT Compiler
C#
MSIL Code
Native Code
Type Safety
Pre-JIT
Econo-JIT
Up Next
Ebook Download
View all
.NET Documentation
Read by 2.3k people
Download Now!
Learn
View all
Membership not found