What is JIT?
Experience Level: Senior
Tags: .NETASP.NET MVCASP.NET WebAPIASP.NET WebFormsC#
Answer
Quick introduction
Before a computer can execute the application, special program that is called compiler must translate its source code into machine instructions.
The compilation can be done either Ahead-Of-Time (AOT) or Just-In-Time (JIT).
So JIT = Just-In-Time
By default .NET uses JIT compiler. It is a part of CLR (Common Language Runtime). The CLR manages the execution of .NET applications.
Compiler types
- AOT - Ahead-Of-Time (Explicit) - compiles the code prior to program executio
- JIT - Just-In-Time (Implicit) - compiles the code on-demand
Good to know
- Output of JIT is not persisted so your managed application has to go through JIT for every launch.
- Pre-compilation (using NGEN) can be used to reduce startup overheads related with JIT compilation
Related C# job interview questions
What do you know about delegates?
.NETC# MediorWhat is MSIL?
.NETASP.NET MVCASP.NET WebAPIASP.NET WebFormsC# SeniorWrite a code that takes an integer number and outputs its digits to the console.
.NETC#Code challenge MediorWhat is variable capturing good for and how does it work?
.NETC# SeniorWhat will be the output of the following code that is using delegates?
.NETC#Code challenge Senior