Copyright Accelerated Ideas 2007 Legacy Blog Posts | Blog Home | .NET Components

How to use the native image generator for performance gain?


1/23/2007

The Native Image Generator (Ngen.exe) is a tool that improves the performance of managed applications. Ngen.exe creates native images, which are files containing compiled processor-specific machine code, and installs them into the native image cache on the local computer. The runtime can use native images from the cache instead using the just-in-time (JIT) compiler to compile the original assembly

Examples

The following command generates a native image for component.dll, located in the current directory:

ngen install component.dll


Uninstalling Images

Ngen.exe maintains a list of dependencies, so that shared components are removed only when all assemblies that depend on them have been removed. In addition, a shared component is not removed if it has been installed as a root.

The following command uninstalls all scenarios for the root component.dll

ngen uninstall component


< Blog Home