Optimizing performance of Windows Forms InitializeComponent automatically
Asked Answered
P

1

6

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()?

Proletarian answered 21/9, 2011 at 17:35 Comment(0)
B
1

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.

Bimanous answered 21/9, 2011 at 17:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.