Solved

Delphi ListView and LARGE query

Posted on 2003-11-12
5
593 Views
Last Modified: 2008-03-10
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
Comment
Question by:Engwi
5 Comments
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 9737528
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
 
LVL 2

Accepted Solution

by:
Robn earned 20 total points
ID: 9739337
are you using beginupdate and endupdate on the listview items?
If not, this will speed up the population of the list.

Regards,
Rob
0
 

Author Comment

by:Engwi
ID: 9739370
Rob

Will try that first and let you know.

Thanks
 Engwi
0
 
LVL 17

Expert Comment

by:Wim ten Brink
ID: 9756047
Have you considered turning the listview into a virtual listview?
0
 

Expert Comment

by:lamtl354
ID: 9761011
what is virtual listview??
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now