Improving NET Application Startup Speed
The .NET Framework is the foundation for all of the .NET based applications on your Windows system. For performance reasons, Windows runs the .NET Framework Optimization Service (its executable is named mscorsvw.exe) to optimize performance of .NET apps on your machine. This service is triggered to activate when a new version of the .NET Framework is first installed or when the Framework later receives patches from Windows Update.
NGEN, the Native Image Generator has been around for several years as part of the .NET Framework. NGEN creates optimized native images of managed code applications which are then used at runtime rather than using the Just-In-Time (JIT) compiler. NGEN has evolved over time so that part of it includes a component that runs as a background service as it attempts to ensure .NET applications are consistently optimized. NGEN may also be run in the foreground on a specific assembly with customized options.
AutoNGEN is the latest evolution of the product which arrived with Windows 8 and has been further refined for Windows 8.1. AutoNGEN represents several improvements over previous iterations. With Windows 8, AutoNGEN was designed to only optimize .NET apps or libraries that are actively being used on the machine. It is also designed to run as more efficiently in the background and yield the processor when the user returns to the machine.
In Windows 8.1 this service seeks to take advantage of Microsoft’s build systems so that .NET-based packages from Microsoft are optimized by a NGEN-like service prior to being made available for distribution. As a result, the AutoNGEN requires much less work to be done on the local machine and avoids distribution of effort across the millions of machines running .NET.
Tom Gilb & Kai Gilb Jan 26, 2015