all groups > dotnet clr > march 2007 >
You're in the

dotnet clr

group:

Why a little slow in startup of .Net applications


Why a little slow in startup of .Net applications Umeshnath
3/27/2007 4:53:17 PM
dotnet clr:


I have experienced a little bit of a slow in when a .net application runs
first. But later it never happens until the system restarts.

I understood the reason is that when ever application runs first JIT
compiler recompiles the assembly and generate a native code that is fully
compatible to our current CPU specifications if the assembly doesn’t have a
native image in its cache. Later it uses from cache hence it executes fast.

My doubts comes here, when application runs first it generate native code
and added to cache then why I am not able to see using the below command

ngen display “Assmblyname” it gives me below error.

Error: The specified assembly is not installed.

Please give me a solution for this, also if I am wrong please correct me.

Re: Why a little slow in startup of .Net applications Günter Prossliner
3/28/2007 12:00:00 AM
Hi!

[quoted text, click to view]

From the CLR's point of view, the generation of native code happens "in
place". The JIT-Compiler compiles the IL in memory.

[quoted text, click to view]

ngen has little to do with the JIT-Compiler. When you use "ngen", the
Compilation is done once, and the compiled native Code is saved within a
file.

You have to use the

ngen install "Assemblyname"

command for this.


After installing the native image, the JIT doens't need to be called by the
CLR at runtime, so executing the Assembly will be faster.


GP

AddThis Social Bookmark Button