Home All Groups Group Topic Archive Search About

Why a little slow in startup of .Net applications

Author
28 Mar 2007 2:05 AM
Umeshnath
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.

Author
27 Mar 2007 11:16 PM
Sashidhar Kokku
I dont think the assembly loading itself into the system cache is the same as
the assembly loading into the GAC.

If you want the assembly to be loaded fast, you should load it into the GAC.

HTH
--
Sashidhar Kokku
ikaSystems Corp


Show quote
"Umeshnath" wrote:

>
> 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.
>
>
Author
28 Mar 2007 1:14 AM
James Crosswell
Sashidhar Kokku wrote:
> I dont think the assembly loading itself into the system cache is the same as
> the assembly loading into the GAC.
>
> If you want the assembly to be loaded fast, you should load it into the GAC.

mmm, I'm not sure that will affect load time. GAC basically allows you
to install assemblies that will be shared by multiple other
assemblies/applications... Putting an assembly in the GAC won't cause it
to be loaded at system startup or cached in any other way... What the OP
was talking about was JIT compilation which is more likely the cause of
the slowdown.

Best Regards,

James Crosswell
Microforge.net LLC
http://www.microforge.net
Author
28 Mar 2007 8:36 AM
Umeshnath
Hi,
You have taken my question in right way, Can you have any solution?


Show quote
"James Crosswell" wrote:

> Sashidhar Kokku wrote:
> > I dont think the assembly loading itself into the system cache is the same as
> > the assembly loading into the GAC.
> >
> > If you want the assembly to be loaded fast, you should load it into the GAC.
>
> mmm, I'm not sure that will affect load time. GAC basically allows you
> to install assemblies that will be shared by multiple other
> assemblies/applications... Putting an assembly in the GAC won't cause it
> to be loaded at system startup or cached in any other way... What the OP
> was talking about was JIT compilation which is more likely the cause of
> the slowdown.
>
> Best Regards,
>
> James Crosswell
> Microforge.net LLC
> http://www.microforge.net
>
Author
28 Mar 2007 8:34 AM
Umeshnath
Hi,
I think you misunderstand the question, my doubt was Why a little slow in
startup of .Net applications.


Show quote
"Sashidhar Kokku" wrote:

> I dont think the assembly loading itself into the system cache is the same as
> the assembly loading into the GAC.
>
> If you want the assembly to be loaded fast, you should load it into the GAC.
>
> HTH
> --
> Sashidhar Kokku
> ikaSystems Corp
>
>
> "Umeshnath" wrote:
>
> >
> > 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.
> >
> >

AddThis Social Bookmark Button