Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 492
Bryan Roth Avatar asked Sep 12 '08 16:09

Bryan Roth


2 Answers

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.

like image 103
Gulzar Nazim Avatar answered Sep 27 '22 20:09

Gulzar Nazim


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.

like image 31
Will Dean Avatar answered Sep 27 '22 20:09

Will Dean