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()
?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With