|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
startup times woes...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 Dupont wrote:
Show quote > I try to understand and improve my application cold start. If it takes 70 seconds to start an application from a cold reboot,> > 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. 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 wonder if I have a problem with my disk....
Show quote "Barry Kelly" <barry.j.ke***@gmail.com> wrote in message news:ls2ie21ofgdvq5ekcsc2qp49ntc7qr1ndb@4ax.com... > Lloyd Dupont wrote: > >> 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 > > -- > http://barrkel.blogspot.com/ > I try to understand and improve my application cold start. Startup time depends on a number of factors. When you load an assembly, it > 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? 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 used NGEN, didn't help..
Show quote "Jim Wooley" <jimNOSPAMwooley@hotmail.com> wrote in message news:24f81e8fb7d48c8931c0292ca60@msnews.microsoft.com... >> 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.aspx > > |
|||||||||||||||||||||||