Mar 6, 2014 at 8:20 PM
Edited May 14, 2016 at 7:37 PM
This article has been moved to
Microsoft introduced a Multicore JIT, which uses parallelization to reduce the JIT compilation time during application startup. With Multicore JIT, methods are compiled on two cores in parallel. The more code you execute on your startup path, the more effective
Multicore JIT will be at reducing startup time.
In .NET 4.5.1 they improved the Multicore JIT. Now it supports dynamically loaded assemblies as well.
How does it work?
It records the work of the JIT every startup and saves it in a binary “profile” file. The file is quite small. It has about 30KB.
The Multicore JIT reads this file during startup and starts pre-compiling the methods in the background that were recorded in the file.
How to use it?
The Multicore JIT is enabled by default for ASP.NET apps and Silverlight 5 apps. In a desktop application it needs to be enabled via the ProfileOptimization class. This is necessary so that we can tell the CLR where to save the profile file.
Multicore JIT vs. NGET
var profileRoot = Path.Combine(Environment.GetFolderPath(
// Define the folder where to save the profile files
// Start profiling and save it in Startup.profile
It is common to use NGEN within the installation for .NET desktop applications. As a result the JIT has not much to do anymore because the assemblies are already pre-compiled. Using the Multicore JIT might still be useful because during development it can reduce
the startup time as well.
- MSDN Blog: An easy solution for improving app launch performance
- MSDN Blog: Announcing the .NET Framework 4.5.1 Preview (see chapter: Multi-core JIT improvements)
- Ngen.exe (Native Image Generator)