startup times woes...

  • Thread starter Thread starter Lloyd Dupont
  • Start date Start date
L

Lloyd Dupont

Hi All!

I try to understand and improve my application cold start.

I already load as little as possible in the Main().

Now I have a test which gives strange results, and I try to understand what
it means.

test 1:
====
I reboot, launch a small .NET executable, which takes 7 seconds, and launch
my application, which takes 30 seconds.

test 2:
====
I reboot, launch my application, which takes 70 seconds.


Now this doesn't add-up, why?
Any idea what's going on?

I'm thinking to write a small "QuickStart" application which "initialize"
everything. How should it work?
 
Lloyd said:
I try to understand and improve my application cold start.

I already load as little as possible in the Main().

Now I have a test which gives strange results, and I try to understand what
it means.

test 1:
====
I reboot, launch a small .NET executable, which takes 7 seconds, and launch
my application, which takes 30 seconds.

test 2:
====
I reboot, launch my application, which takes 70 seconds.

If it takes 70 seconds to start an application from a cold reboot,
there's got to be something wrong somewhere. Is it thrashing? Are there
huge data files / assemblies that are extremely fragmented on disk? Is
there a lot of I/O?

FWIW, starting a small .NET executable from a cold restart does not take
7 second on my machine - it takes about 2.7 seconds.

-- Barry
 
I try to understand and improve my application cold start.
test 1:
====
I reboot, launch a small .NET executable, which takes 7 seconds, and
launch
my application, which takes 30 seconds.
test 2:
====
I reboot, launch my application, which takes 70 seconds.
Now this doesn't add-up, why?
Any idea what's going on?
I'm thinking to write a small "QuickStart" application which
"initialize" everything. How should it work?

Startup time depends on a number of factors. When you load an assembly, it
needs to load all referenced assemblies. As it is loading them, it checks
to see if they have been JIT'ed (Just in time compiled). If you are not familiar
with the JIT, here it is in a nutshell: When you compile your application,
you compile it to Intermediate Language (IL). When you run it, the .Net runtime
converts the IL into machine code Just in Time (JIT) and caches the result
in a local store until the machine is rebooted. Each time you reboot, it
will perform the JIT the first time it on each reboot.

If you want your application not to JIT and can target it to a specific machine
configuration, you could use the NGEN tool which will create the native compiled
version and skip the need for a JIT. I have seen a number of packaged applications
which include a NGEN at the end of the install process (including VS/SQL/etc).


Jim Wooley
http://devauthority.com/blogs/jwooley/default.asp
 
I used NGEN, didn't help..

Jim Wooley said:
Startup time depends on a number of factors. When you load an assembly, it
needs to load all referenced assemblies. As it is loading them, it checks
to see if they have been JIT'ed (Just in time compiled). If you are not
familiar with the JIT, here it is in a nutshell: When you compile your
application, you compile it to Intermediate Language (IL). When you run
it, the .Net runtime converts the IL into machine code Just in Time (JIT)
and caches the result in a local store until the machine is rebooted. Each
time you reboot, it will perform the JIT the first time it on each reboot.

If you want your application not to JIT and can target it to a specific
machine configuration, you could use the NGEN tool which will create the
native compiled version and skip the need for a JIT. I have seen a number
of packaged applications which include a NGEN at the end of the install
process (including VS/SQL/etc).

Jim Wooley
http://devauthority.com/blogs/jwooley/default.aspx
 
I wonder if I have a problem with my disk....

Barry Kelly said:
If it takes 70 seconds to start an application from a cold reboot,
there's got to be something wrong somewhere. Is it thrashing? Are there
huge data files / assemblies that are extremely fragmented on disk? Is
there a lot of I/O?

FWIW, starting a small .NET executable from a cold restart does not take
7 second on my machine - it takes about 2.7 seconds.

-- Barry
 
Back
Top