#83 – JIT Compilation in .NET

.NET assemblies, stored as .exe or .dll files, contain managed Intermediate Language (MSIL) code, rather than native x86 or x64 code.  When you run an .exe that contains managed code, MSIL code is converted to native x86 or x64 code by the just-in-time (JIT) compiler.

The JIT compiler compiles code as needed, when the code is about to be executed.  It then stores the compiled code in memory, avoiding re-compilation if the code needs to be executed later, while the process is running.

The same MSIL code can therefore be run on both x86 and x64 systems, since the MSIL code is compiled to the appropriate architecture at run time.

You can also “pre-JIT” MSIL code, compiling it to a particular target architecture before the code is actually run.  This is done using the Native Image Generator (ngen.exe), typically at install time.

Advertisement

About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: