Solved

Delphi ListView and LARGE query

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
System restore point 4 91
oracle global variables 4 63
Base1 Encode/Decode 3 68
RESTRequest Parameter 4 15
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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

863 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

23 Experts available now in Live!

Get 1:1 Help Now