Hi,
We're finishing our Windows Forms application, using .NET 2.0. Our
application is really big, about 1,000,000 lines of code and some 400+
forms and user controls. Startup time is really slow, although we're not
doing much at all, just showing the login screen. Also, during
execution, the loading process of user controls can be slow.
Basically, I wanted to know what can be done to improve application
startup time and general performance.
Thanks in advance for any help given.
Regards,
paulo
Parheric - 01 Jun 2006 14:06 GMT
One option is to run profiling tools to see what section of code is slowing
it down. Other than that I am not aware of any other ways to pin point slow
code.
You could also ngen the assemblies, see if that makes a difference.
> Hi,
>
[quoted text clipped - 9 lines]
> Regards,
> paulo
Bill O'Neill - 02 Jun 2006 01:25 GMT
There have been some good articles in various issues of MSDN magazine this
year: http://msdn.microsoft.com/msdnmag/
We have a similar size application and the following helped us:
1. Reference as few assemblies as possible. This is tricky. I'm not saying
not to use all the great tools in the .NET Framework, but reference as few
distinct classes as possible in your start up code. For example, one
reference to a class in System.Xml will require that the assembly be loaded.
Assembly load time is very, very costly. My initial guess is this is what
you are experiencing.
2. Make sure you are using release builds with optimized code. I know this
seems obvious.
3. Use NGen to compile your assemblies to native instructions. This can
eliminate the need to JIT.
4. Sign all your assemblies and put them in the GAC. If your assemblies are
not in the GAC then all pages of the assembly must be loaded and validated
before you can use the assembly. This is expensive!
5. Specify load addresses on your assemblies to avoid rebasing.
This article helped me a lot:
http://msdn.microsoft.com/msdnmag/issues/06/02/CLRInsideOut/default.aspx.
I hope that helps. If it does help, and when you find time <grin>, I would
appreciate it if you shared your performance metrics with me. I can be
reached at bil_lo@c_u.net (remove all underscores).
Best of luck!
Bill O'Neill
Enterprise Architect
Computers Unlimited
> Hi,
>
[quoted text clipped - 9 lines]
> Regards,
> paulo
steve - 02 Jun 2006 15:46 GMT
Bill,
Thanks for including that link; we've beem grumbling about the startup time
for one of our apps for some time now.
Steve
> This article helped me a lot:
> http://msdn.microsoft.com/msdnmag/issues/06/02/CLRInsideOut/default.aspx.
paulo - 05 Jun 2006 11:25 GMT
Hi Bill,
I will try to implement your advice.
If I figure out anything important beyond the information you provided,
I will gladly contact you.
Thanks for your help.
Regards,
paulo
> There have been some good articles in various issues of MSDN magazine this
> year: http://msdn.microsoft.com/msdnmag/
[quoted text clipped - 41 lines]
>> Regards,
>> paulo
john conwell - 20 Jun 2006 22:12 GMT
One hint. I recently when through the app startup optimization process.
These tips are good. The one thing i'd skip is worrying about the base
address of your dll's. Our product has about 30 dlls and I went through the
fun of calculating unique base addresses for each dll so they dont get
rebased at runtime. took about a day all said, and I didnt get an ounce of
measurable startup time reduction.
I dont think its worth the hastle of doing and maintaining
> There have been some good articles in various issues of MSDN magazine this
> year: http://msdn.microsoft.com/msdnmag/
[quoted text clipped - 41 lines]
> > Regards,
> > paulo
Joris Zwaenepoel - 15 Jun 2006 14:58 GMT
I recently read an article or a blog (unfortunatly, I don't remember where,
so I cannot provide a link) about application startup time. One of the
options mentioned in the article was to split the application in multiple
smaller assemblies. This would result in faster startup time, but also
multiple smaller delays when other parts of the application are started, and
their assemblies need to be loaded at that time.
I haven't tried it (yet), but maybe it could help you.
Also, although it does not speed up the startup, showing a splash screen
during startup can improve the experience for the user that is waiting.
Joris
> Hi,
>
[quoted text clipped - 9 lines]
> Regards,
> paulo