I am running performance profile for a C# 开发者_JS百科application on a virtual machine. The results shows a huge load of "JIT Compiler". When I dig further, it shows something called "Class Loader" as the only method getting called by JIT compiler.
What should I do to bring "JIT compiler" load down?
JIT is the 'Just In Time' compiler, this essentially compiles your C# into executable code that can work on the current processor.
.Net comes with a utility called NGEN, this creates a native image of your C# code, that doesn't need to be JIT'ted. There are downsides to this however, have a read of this:
http://codeidol.com/csharp/net-framework/Assemblies,-Loading,-and-Deployment/Native-Image-Generation-%28NGen%29/
And finally here's a link to the MS info about NGEN:
http://msdn.microsoft.com/en-us/library/6t9t5wcf%28VS.80%29.aspx
You could try using NGEN to pre-JIT your assemblies to native images. This will lessen Jitting overhead on application load:
http://msdn.microsoft.com/en-us/library/6t9t5wcf(VS.80).aspx
You should run this tool on the machine where your assemblies are i.e. your virtual machine.
精彩评论