InitializeComponent takes 3 seconds, can I do anything to speed it up?

D

deerchao

Hi, I have a MainForm with Lots of Menu Items in a MenuStrip control,
several items in a StatusStrip, and a DockPanel from DockPanel Suite.
The problem is it takes 3 seconds long to execute the
InitializeComponent() mehtod generated by Visual Studio on Windows XP
in a "cold start" - the first time starting a .net application after
boot. And I have other codes to run at startup, so the total time adds
to about 7 seconds, which should not be considered as accectable.

I can optimize my own code, but is there any way to reduce the time
InitializeComponent() costs?

Thanks!
 
W

Willy Denoyette [MVP]

deerchao said:
Hi, I have a MainForm with Lots of Menu Items in a MenuStrip control,
several items in a StatusStrip, and a DockPanel from DockPanel Suite.
The problem is it takes 3 seconds long to execute the
InitializeComponent() mehtod generated by Visual Studio on Windows XP
in a "cold start" - the first time starting a .net application after
boot. And I have other codes to run at startup, so the total time adds
to about 7 seconds, which should not be considered as accectable.

I can optimize my own code, but is there any way to reduce the time
InitializeComponent() costs?

Thanks!


You might try to ngen the assembly.

Willy.
 
D

deerchao

Thanks, if I do ngen, then I have to strong name my assemblies, and
put them into GAC, right?
Do I still have a chance to easily upgrade them?

My application have a light weight upgrade feature, it simplely
compares the version info of local dlls/exe file to the info it gets
from network, then it download the new ones to replace the old ones.
Using ngen, is there any easy way to upgrade? I release my application
very offen, in about every 3 days.

Thanks again!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top