Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Optimizing performance of Windows Forms InitializeComponent automatically

I have a program with a full GUI that takes around 750 ms to load thanks to InitializeComponent(). After some research, it seems there are a few techniques to improve the time it takes for .NET to trundle through the InitializeComponent section. These include:

1: Using NGen or similar.

2: Using multi-threading as shown in Speed-optimise Windows Forms application

3: Miscellaneous techniques such as setting control properties before adding them as shown in Optimising InitializeComponent (takes 1 second!).

Unfortunately (1) only improved my case by around 20%, and (2) and (3) are time consuming to implement, and sacrifice the convenience of the full GUI designer.

Are there any automated solutions out there that take the source code directly, and produce a shorter, more efficient InitializeComponent()?

like image 962
Dan W Avatar asked Sep 21 '11 17:09

Dan W


1 Answers

For a Windows Forms application, a 750 ms startup time is quite good actually. Unless you want to spend countless hours just to gain another 20%, concentrate your efforts to user convenience.

I highly doubt that there is an automated solution for this by the way, it would be very hard for a tool to guess what is not needed for your design.

like image 71
Teoman Soygul Avatar answered Oct 08 '22 01:10

Teoman Soygul