Optimizing Windows Forms InitializeComponent Performance Automatically

I have a full GUI program that takes about 750 µs to load thanks to InitializeComponent() . After some research, it seems that there are several methods to improve the time it takes .NET to go through the InitializeComponent section. These include:

1: Use NGen or similar.

2: Using multithreading as shown in Optimizing Windows Forms Speed

3: Various methods, such as setting control properties before adding them, as shown in Optimizing InitializeComponent (takes 1 second!) .

Unfortunately, (1) only improved my case by about 20%, and (2) and (3) take a long time to implement and sacrifice the convenience of a full graphic designer.

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

+6
source share
1 answer

For a Windows Forms application, the startup time of 750 ms is actually pretty good. If you don’t want to spend countless hours to get another 20%, focus on user convenience.

I very much doubt that there is an automated solution for this, it would be very difficult for the tool to guess what is not needed for your design.

+1
source

Source: https://habr.com/ru/post/897772/


All Articles