Bryan Roth
Bryan Roth

Reputation: 10749

Optimize Windows Form Load Time

I have a Windows Form that takes quite a bit of time to load initially. However, each subsequent request to load the Form doesn't take as long. Is there a way to optimize a Form's load time?

Upvotes: 5

Views: 4249

Answers (2)

Will Dean
Will Dean

Reputation: 39530

You need to find out where the time is going before you can optimise it. Don't just ngen it without finding that out first, as if the problem is loading a 150MB background bitmap resource then you won't have done anything useful at all with ngen.

You should disregard all specific advice or hunches about optimisation which arise without any measurements being made.

Upvotes: 5

Gulzar Nazim
Gulzar Nazim

Reputation: 52198

You can use ngen.

I also use this tip to reduce the Memory footprint on startup.

The Native Image Generator (Ngen.exe) is a tool that improves the performance of managed applications. Ngen.exe creates native images, which are files containing compiled processor-specific machine code, and installs them into the native image cache on the local computer. The runtime can use native images from the cache instead using the just-in-time (JIT) compiler to compile the original assembly.

Upvotes: 10

Related Questions