Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / February 2007

Tip: Looking for answers? Try searching our database.

Combobox performance

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Fad - 12 Feb 2007 20:06 GMT
I've measured the execution time of the following code, and it's
variable from 0,5 sec to 1 sec..
How I can improve performance..?

for (int i = 0; i < 8; i++)
   {
       myCombobox1[ i ].Items.Clear();
       myCombobox1[ i ].Items.AddRange(stringArray1);

       myCombobox2[ i ].Items.Clear();
       myCombobox2[ i ].Items.AddRange(stringArray2);
   }

Thanks,
Fad
Ciaran O''Donnell - 13 Feb 2007 11:35 GMT
Just a stab in the dark, try bindingsources.

Signature

Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com

> I've measured the execution time of the following code, and it's
> variable from 0,5 sec to 1 sec..
[quoted text clipped - 11 lines]
> Thanks,
> Fad
Oliver Sturm - 13 Feb 2007 18:05 GMT
Hello Fad,

>I've measured the execution time of the following code, and it's
>variable from 0,5 sec to 1 sec..

<snip>

I'm pretty sure that, given a sensible size of the arrays stringArray1 and
stringArray2, this code should not take any significant time to execute.
Of course you're leaving out the sizes of said arrays from your post,
although they surely represent the most important piece of information.

Otherwise, your source code strikes me as highly theoretical - I've never
written an application with arrays of combo boxes that were all filled
with the same content... may be me, of course.

Finally, to answer your question from a generic standpoint: you improve
application performance by analyzing the source of any perceived
performance problems using a profiler. That is a tool which can, after an
application run, give you statistics of the numbers of times a certain
piece of code has been executed, and the time spent in each or all these
runs. My personal preference for such a tool is "AQTime" by Automated QA,
but there are lots of others out there.

               Oliver Sturm
Signature

http://www.sturmnet.org/blog

Fad - 16 Feb 2007 08:09 GMT
Hi Sturm,

StringArray1 and StringArray2 have a size of 20-25 items.
I think that is a too small size for the execution time of my
application.

In my application is necessary to have multiple combobox with the same
items.. I have created array for a fast coding..

I will try AQTime.. I hope that this tool can help me..

Thanks,
Stefano

Oliver Sturm ha scritto:

> Hello Fad,
>
[quoted text clipped - 23 lines]
> --
> http://www.sturmnet.org/blog

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.