Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 640
  • Last Modified:

Delphi ListView and LARGE query

Greetings

I have a listview on my form that gets populated by records from either a flat file or SQL server database.

With the flat file for example, if the amount of records starts to exceed 10 000
the reporting becomes way to slow and GUI locks up while in the loop of retrieving the records.

Should I look at having a seperate thread doing the work ?

Iterating through the records consumes only a couple of seconds, but uncommenting the code that places the data in the listview and then running the query takes up time ?

Any suggestions ?
 
Regards
 Engwi
0
Engwi
Asked:
Engwi
1 Solution
 
sudhakar_koundinyaCommented:
Ok

some suggestions

1. If you are getting total information with in few seconds, i suggest to take that info in dynamic collection classes (i.e dynamic vectors or hash tables or linked lists)  say 1000 per class for example

2. Create the thread that adds the information in the list
3. create the instance to new thread, send the ppointer of collection object  to the thread instance and start the thread.
4. like that call all threads at a time.
5. But take care that only 10 to 20 threads (depending on system peformance) should be in running mode. i.e at any moment of time ,  application execution should only support 10 to 20 threads
6. take care of syncronization to the listbox object also (if necessary)

hope you got my ideas.


Regards,
Koundinya
0
 
RobnCommented:
are you using beginupdate and endupdate on the listview items?
If not, this will speed up the population of the list.

Regards,
Rob
0
 
EngwiAuthor Commented:
Rob

Will try that first and let you know.

Thanks
 Engwi
0
 
Wim ten BrinkCommented:
Have you considered turning the listview into a virtual listview?
0
 
lamtl354Commented:
what is virtual listview??
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now