Native Image Generation

Having to pay the price to JIT-compile application code and the class library assemblies on which it depends doesn’t sound like a great idea. After all, once an assembly has been deployed to a target machine, the processor architecture is certain, and all repeated JIT compilations of the code in those assemblies will result in the same corresponding native code. It seems we want a mechanism where we can still deploy IL-based assemblies (for all the benefits previously mentioned) but go through the burden of JIT compilation only once.

To counter this concern, the CLR has the concept of native image generation, or NGEN. The simplest way to think about NGEN is as an offline version of the JIT compiler that can be invoked ...

Get C# 5.0 Unleashed now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.