Tuesday, October 15, 2013

MJIT – Multicore Just-In-Time Compilation

Managed Execution Environments brought us a new world. The advantages are priceless and this paradigm changed the way we develop software solutions. However, it does have a downside: It adds overhead. For extremely high performance software (real-time critical), you would still write native apps, but as time passes and hardware capabilities increase, the overhead will be irrelevant. Nevertheless, improvements to the way the execution engine works are always welcome. Putting aside the NGEN feature, the .NET 4.5 introduced Multicore Just-in-time compilation, "which uses parallelization to reduce the JIT compilation time during application startup."

Check it out:

One cool detail:
"Multicore JIT is on by default for Silverlight 5 and ASP.NET applications, but not for desktop applications. The main reason for this is that the CLR needs a place to save and load the files containing the JIT profile information. Silverlight 5 and ASP.NET applications are hosted applications and the host provides a good place to store the profile information. We also know that all of these applications have a similar startup path and will be able to take advantage of MCJ. For desktop applications we don't have a good location to put the profile, and not all applications will benefit from MCJ on process startup. For desktop applications, we chose to provide a set of APIs that can be used to "opt-in" if it will benefit your application."

More resources:
Check Vance Morrison (.NET Performance Architect) and Dan Taylors (Multicore JIT program manager) interview on Channel9.