views:

56

answers:

2

I am running performance profile for a C# application on a virtual machine. The results show huge load of "JIT Compiler". When I dig further in, it shows something called "Class Loader" as the only method getting called by JIT compiler.

What do I do to bring "JIT compiler" load down?

+1  A: 

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.

chibacity
+1  A: 

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

Russ C
So this means JIT load most likely comes at the startup only?? or the first time a function gets executed?
bsobaid
The JIT Load will come at startup, or dynamically loaded Assemblies.You'll also trigger it, in ASP.Net when using Control.LoadControl().
Russ C