How can I trace the JIT compilation of an application? We have a small asp.net application that is part of a larger website (classic asp for the rest of the code) so it’s not accessed very frequently and is (likely) recompiling after a timeout or app pool recycle. The recompilation is taking up to 2 minutes!!
Is there a tracing tool or counters in perfmon that can help me trace what exactly is going on?
I was going to try and precompile but I think timeouts and app pool recycles will render that useless. (or is that a bad assumption?)
Thx in advance!
If you truly believe that the problem is Jit, you can use .NET Performance Counters. Open the “Performance” Management Console (it varies by operating system) and click the +, then add the
.NET CLR Jitcounter:This will allow you to get some simple metrics about Jit, how much time is being spent in it, etc.
Now, I don’t think the problem is entirely on “Jit”. It might be ASP.NET compiling your application into
Temporary ASP.NET Files, it might be Strong Name signature checking, etc. I would consider many other things besides the CLR Jit.Jit specifically is when IL code is compiled into native code by the runtime, or finds it in NGEN. Your whole application doesn’t get JITed all at once – each method is JITed on a case by case basis.
I think your best shot is to also look at the Compilations Total counter under the
ASP.NET Applicationsobject, and try pre-compiling your website.