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

dotnet academic

group:

Why a little slow in startup of .Net applications



Why a little slow in startup of .Net applications Umeshnath
3/27/2007 5:22:32 PM
dotnet academic:

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 Mattias Sjögren
3/28/2007 12:00:00 AM
[quoted text, click to view]

No, the compiled native code is not automatically stored in the NGEN
cache when the assembly is first used. That only happens when you
actually run Ngen.exe.

If you see faster startup times after the first, it's probably dues to
other things being cached, and the fact that the CLR has already been
loaded.


Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
AddThis Social Bookmark Button