Solved

Delphi ListView and LARGE query

Posted on 2003-11-12
5
598 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

856 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