How do I speed optimize Windows Forms applications?
I am not talking about apparent .NET optimisation techniques - like NGEN-ing, caching objects, etc. I already tried that and what I am up to is to reduce the form initilization time from a 1500 msec down to 500 msec.
Profiling has identified the slowest code and almost all of it is in the InitializeComponent
, and within this method the slowest lines is
- creation of the (just new-ing) WebBrowser component
- loading icon from a resource (hideous 500 msec)
- creation of the
ContextStripMenu
- several
this.Controls.Add()
calls contribute a lot too.
At the moment, I can only see how to fix point (2) - move icon data from being stored as embedded resource to a private field (for example, Base64-encoded string).
What what should I do with points 1, 3 and 4?