What is JIT?

Experience Level: Senior
Tags: .NET ASP.NET MVC ASP.NET WebAPI ASP.NET WebForms C#

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
.NET challenge
.NET challenge

Are you learning C#? Try our test we designed to help you progress faster.

Test yourself