- Native Image Generator
-
The Native Image Generator, or simply NGEN is the Ahead-of-time compilation service of the .NET Framework. It allows a .NET assembly to be pre-compiled instead of letting the Common Language Runtime do a Just-in-time compilation at runtime. In some cases the execution will be significally faster with AOT than with JIT.
General information
The Native Image Generator produces a native binary image for the current environment (i.e.; operating systems). This eliminates the JIT overhead at the expense of portability and disk space; whenever an NGEN-generated image is run in an incompatible environment, .NET framework automatically reverts to using JIT. Once NGEN is run against an assembly, the resulting native image is placed into the Native Image Cache for use by all other .NET assemblies. This makes it possible, for example, to use NGEN to process .NET assemblies at installation time, saving processor time later on, when the end-user invokes the application on their system.
NGEN is intended to make the assembly execute faster by removing the JIT compilation process at runtime, but this does not always improve performance because some optimizations can be done only by a JIT compiler (e.g., if the JIT compiler knows that the code is already running with full trust, it can skip certain expensive security checks). Because of this fact, it makes sense to use NGEN only after benchmarking the application performance before and after it.
See also
External links
- Common Language Infrastructure (Standard ECMA-335)
- “ECMA C# and Common Language Infrastructure Standards” on MSDN
- Speed: NGen Revs Up Your Performance With Powerful New Features -- MSDN Magazine, April 2005
.NET Framework Architecture CLI Languages Common1Other2Components ADO.NET (Entity Framework · Data Services) · ASP.NET (AJAX · MVC · Dynamic Data) · Language Integrated Query · CardSpace · ClickOnce · Communication Foundation · Dynamic Language Runtime · Forms · Presentation Foundation · Remoting · Workflow Foundation · XAML · Parallel Extensions · Managed Extensibility FrameworkOther implementations Mono · Compact Framework · XNA Framework · Micro Framework · Portable.NET · Silverlight · SSCLI · DotGNUComparisons Upcoming "Jasper" · "Roslyn"Past "Acropolis"Tools 1 Languages that are, will be, or have been included with Visual Studio or Microsoft Windows.
2 Non-academic or research languages with relatively large user-bases.Categories:- Microsoft development tools
- .NET framework
Wikimedia Foundation. 2010.