Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Binding Issue Part 2

Status
Not open for further replies.

DarkConsultant

Programmer
Dec 4, 2007
156
GB
Hi All,

I was unsure as to wether to carry this on using the previous thread (thanks again, jebenson).

My problem with binding has now been cured but ...

i am filling the items collection of a combobox with between 0 and 10,000 (yep 10,000) KeyValuePairs(of Integer,String) and at the same time filling the AutoCompleteCustomSource with the same strings.

I can hear you all say why dont you set the AutoCompleteMode to ListItems, keep that thought in mind.

Using 5,000 contacts:

Method 1.
Get data from db and manually fill both collections. Time taken 9.1 seconds.

Method 2.
Get data from db and cache Items data locally in a List(Of Integer, String) and string data (for AutoComplete) in a List(Of String). On demand Bind combobox to items list and fill AutoComplete from strings list. Time taken 4 seconds first time and (because data is cached) and 3.8 seconds subsequent. If I omit the AutoComplete strings the times are 3.9 and 3.7 respectively.

Method 3.
Get data from db and cache Items data locally in a List(Of Integer, String) and string data (for AutoComplete) in a List(Of String). On demand fill both collections from cache. Time taken 3.1 seconds first time and 2.8 seconds subsequent.

Am I going nuts? How can method 3 be the fastest?

The AutoCompleteSource can be set to ListItems but this adds around 5 seconds to the timings??

Yesterday my email server got bombed for the first time (1,000,000+ spam emails), my main backup drive went mooky (thank God for secondary backups) and now my VB world has been turned upside down.

I am obviously using method 3 as it is the most efficient but any idea why Method 2 is so slow?

TIA

David

DarkConsultant

Live long and prosper \\//
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top