TechTalkz.com Logo

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Programing Languages > C#(C Sharp)

Notices

Reply
 
Thread Tools Display Modes
Old 19-10-2007, 05:31 PM   #1
deerchao
Guest
 
Posts: n/a
InitializeComponent takes 3 seconds, can I do anything to speed it up?

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!

  Reply With Quote
Old 19-10-2007, 06:30 PM   #2
Willy Denoyette [MVP]
Guest
 
Posts: n/a
Re: InitializeComponent takes 3 seconds, can I do anything to speed it up?

"deerchao" <deerchao@gmail.com> wrote in message
news:1192790904.715332.94350@e34g2000pro.googlegro ups.com...
> 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.

  Reply With Quote
Old 19-10-2007, 06:30 PM   #3
deerchao
Guest
 
Posts: n/a
Re: InitializeComponent takes 3 seconds, can I do anything to speed it up?

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!

On Oct 19, 7:35 pm, "Willy Denoyette [MVP]"
<willy.denoye...@telenet.be> wrote:
> "deerchao" <deerc...@gmail.com> wrote in message
>
> news:1192790904.715332.94350@e34g2000pro.googlegro ups.com...
>
> > 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.



  Reply With Quote
Reply

Thread Tools
Display Modes




New To Site? Need Help?

All times are GMT +5.5. The time now is 03:18 PM.


vBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2009, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional