Friday, November 8, 2013

Profile optimization (Improved startup performance) in .Net 4.5

This is also known as Multicore JIT

Problem
When the application is run, the IL code is read by the CLR and JIT compiled into native code for the particular machine

So the compilation from the IL Code to the native code happens when the application is actually running. So application generally takes lot of time at start up.
 
Profile optimization is improvement over start up time.
 
Profile optimization
 
·         The fundamental problem with JIT compilation is , Jitting is normally a lazy operation, it Jits a method and do not know what next method is for jitting. So the solution is it has to remember something from previous run which is all the jitting that happened
 
·         .net framework 4.5 supports this optimization using application profiles. Now we can enable the profile optimization for an application. Based on the historic profile, it keeps JIT compiling the methods in the background. So when the code is actually needed for execution, it is already in native format so the runtime doesn't have to wait for this.
 
·         Profile is nothing but a simple file which has a list of methods which the application will need during startup
 
·         Multicore JIT parallelizes the some of the JIT compilations that happens on the start of the application
 
Profile optimization requires a multicore computer. The methods are ignored on other computers

No comments:

Post a Comment