To find methods that use the most time for JIT compiling, use the Performance profiler:
-
Create a profiling project for your application and select the Performance profiler from the Profilers list.
-
In the Performance Profiler Options dialog or in the Profiler Options dialog, enable the Profile .NET runtime option.
-
Profile the application using the Elapsed Time, User Time or User+Kernel Time counter.
-
Get results and locate a record for the <JIT Compiler> fictitious routine in the Report panel.
-
Switch to the Calls tab of the Details panel and sort the records of the Parents pane by the desired timing column, Time or Time with Children.
The top of the list in the Parents pane holds the most time consuming methods. You may think of preJITing them to save on run time.
-
The Children pane for <JIT Compiler> will display methods that were called while the JIT compiler was working.
In addition, you can learn the number of times a method was JITted during the run. To do this, select the method in the Report panel, switch to Details and count how many times <JIT Compiler> is reported in the Children pane.
See Also
Performance Profiling
Best Practices and How to Tutorials
Performance Profiler - Overview