Improving Performance of WinForms Apps

We have an internal application called Headtrax that allows Microsoft employees to
handle common HR tasks (such as hiring new staff, name and address changes, team restructuring
and other database queries). In the past, this application used to be web-based (ASP),
but has more recently been upgraded to a .NET Windows Forms application, allowing
for far greater interactivity and integration with other apps (you can create a Visio
diagram or Excel spreadsheet out of an orgchart, for instance).

Over the last few months, some of the CLR perf team have been looking at this application,
in particular with a view to improving the startup time - something that can sometimes
be an issue for WinForms apps. The results of their study can be found
buried deeply on GotDotNet
, and make for interesting reading.

Some of the lessons learnt might seem obvious (use asynchronous, rather than synchronous
web service calls), but others are quite interesting (such as a comparison of
the performance of GACed components versus local components, and creating a bootstrap
exe to get things kicked off as soon as possible).

Worth a read if you're building WinForms applications today and want some tips on
improving their performance, anyway. (Thanks to Nigel for the tip.)

That's my last post for the weekend - for the next week, get ready for an avalanche
of session notes from the PDC! I'll try and upload my notes several times a day, so
check back regularly from Monday.

Comments (2)

  1. Anonymous says:

    Great weblog. Found it via

    Anyway, one extra trick that can be done to speed up the application is to have load headtraxstart.exe load headtrax.exe immediately upon startup in hidden mode (I believe shell(x.exe, vbHidden) in old vb6). Then check for the new version. If the version hasn’t changed, simply unhide the main app. If the version did change, terminate headtrax.exe , download the new version and load. This should probably shave another second off the startup.

  2. Anonymous says:

    The ngen/gac numbers are staggering. I’d previously thought that for core apps, like headtrax, this could be a great way to speed up performance. Now I’m curious as to why the numbers show what they do. WHY??

Skip to main content