views:

701

answers:

5

I have a simple .NET 2.0 windows form app that runs off of a networked drive (e.g. \MyServer\MyShare\app.exe). It's very basic, and only loads the bare minimum .NET libraries. However, it still takes ~6-10 seconds to load. People think something must be wrong that app so small takes so long to load.

Are there any suggestions for improving the startup speed?

+1  A: 

Setup Clickonce for the app so it's deployed to the local machine.

Eric Haskins
This may or may not help...Clickonce will have to check the server for the latest version.
Smallinov
You can write a few lines of code to prevent it from checking on load, and check for updates asynchronously.
Eric Haskins
A: 

You could cheat like Microsoft Office (and Adobe I think) and add an app in the Startup group that tells the app to load and then immediately unload. That way the DLL's are pre-cached in memory for when the user tries to start the app. Only catch: I'm not completely sure if it works this way with networked files -- and if it doesn't, this might be the cause of the slow start (ie you're always doing a cold start vs a possible warm start if running from the local machine).

DougN
I just loves those hacks, just hate them for slowing up my system when used
Claus Thomsen
-1. Crapping all over the user's machine is not a substitute for fixing your performance problems
Orion Edwards
+3  A: 

Try out Sysinternals Process Explorer. It has an column of "% time in JIT". If that number is large you could run ngen on your application. If it's not it's likely to be a slow network connection. CodeGuru has a tutorial on usage of ngen.

hometoast
+3  A: 

To speed up load time, you can compile a tiny start application and let that application do the loading of assemblies in runtime from a library outside bin folder.

http://support.microsoft.com/kb/837908

Claus Thomsen
+3  A: 

Determining JIT time for weighing NGEN feasibility is certainly a good starting point. I also would agree with those who look to fudge the load time by using another entry point to then load the assemblies. Often it's the appearance of speed versus actual speed that improves the user experience.

Mike L