First time loading after machine restart

J

Jack Wright

Dear All,
I have developed a client .net application...that takes 3 seconds
to load after the machine has been booted...now after the user closes
this exe and lauches it again, it takes less than a second to lauch...
Is MS storing something in memory? Does this mean that after I
re-lauch my application it does not get compiled again? Is my
following assumption wrong:
1. Every application loads its own CLR.
2. Every application (that is not NGen ed) gets complied again.
3. Every application starts with a default domain that interally
creates the application specfic domain.
4. The default domain gets unloaded when the exe is shut down.

Is there some caching of machine code taking place? Where does it
stored? I need to answer my clients these questions...

Please help...I need to answer them asap...

TALIA
Many Regards
Jack
 
J

Jon Skeet [C# MVP]

Jack Wright said:
I have developed a client .net application...that takes 3 seconds
to load after the machine has been booted...now after the user closes
this exe and lauches it again, it takes less than a second to lauch...
Is MS storing something in memory? Does this mean that after I
re-lauch my application it does not get compiled again? Is my
following assumption wrong:
1. Every application loads its own CLR.
2. Every application (that is not NGen ed) gets complied again.
3. Every application starts with a default domain that interally
creates the application specfic domain.
4. The default domain gets unloaded when the exe is shut down.

Is there some caching of machine code taking place? Where does it
stored? I need to answer my clients these questions...

After you've executed the application once, it (and most importantly,
the CLR) is likely to be in your disk cache. I suspect it's disk access
as much as anything else which is slowing things down. Try not using
the app (or any other .NET apps) for a long time, while doing other
things, and then start it again - I suspect you'll see the slow
performance again.
 
C

Chris, Master of All Things Insignificant

To add to Jon,

The second time you launch the app, the JIT looks to see if there is a new
version that needs to be compiled. So if you place a new version of the dll
into the directory it will use that one the next time around. It's not
really cached as it is compiled until it needs to be compiled again.
Rebooting does tell it to recompile.

Chris
 
J

Jon Skeet [C# MVP]

Chris said:
To add to Jon,

The second time you launch the app, the JIT looks to see if there is a new
version that needs to be compiled. So if you place a new version of the dll
into the directory it will use that one the next time around. It's not
really cached as it is compiled until it needs to be compiled again.
Rebooting does tell it to recompile.

I don't believe that the JITted version is cached at all though. I
could be wrong, but I didn't think any caching at that level was
involved...
 
W

Willy Denoyette [MVP]

Chris said:
To add to Jon,

The second time you launch the app, the JIT looks to see if there is a new
version that needs to be compiled. So if you place a new version of the
dll into the directory it will use that one the next time around. It's
not really cached as it is compiled until it needs to be compiled again.
Rebooting does tell it to recompile.

Chris

No, it's just like Jon said, the runtime (and program )modules are loaded
from the filesystem cache the second time you start a managed program.
Jitted code don't get cached.

Willy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top