Click below for Step by Step and Interview Q & A (dotnetinter) wrote,
Click below for Step by Step and Interview Q & A
dotnetinter

.NET interview questions: - What are different types of JIT?

In Microsoft .NET there are 3 types of JIT compilers:-

  • Normal-JIT (Default): - Normal-JIT compiles only those methods that 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.

  • Econo-JIT: - Econo-JIT compiles only those methods that are called at runtime. However, these compiled methods are not stored in cache so that RAM memory can be utilized in an optimal manner.

  • Pre-JIT: - Pre-JIT compiles complete source code into native code in a single compilation cycle. This is done at the time of deployment of the application. We can implement Pre-jit by using ngen.exe.

Normal-jit is the default implementation and it produces optimized code. Econo-jit just replaces IL instruction with native counterpart. It does not do any kind of optimization. Econo-jit does not store the compiled code in cache so it requires less memory.

The choice of Normal-JIT and Econo-JIT is decided internally. Econo-JIT is chosen when devices have limitation memory and CPU cycle issues like windows CE powered device. When there is no memory crunch and CPU power is higher than Normal-JIT is used.

Pre-JIT is implemented by using ngen.exe.

Ngen storesfull compiled.NET native code in to cache. In other words rather than dynamically compiling the code on run time a full image of native compiled code is stored in cache while installing the application. This leads to better performance as the assembly loads and execute faster.

In order to install full compiled native code in cache we can execute the below command line from your visual studio command prompt.

exe

Also see below video on weak name references: -

Tags: .net interview questions, csharp interview questions, econo, it interview questions, jit, native, ngen, programming interview questions, weak reference
Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments