Robert,
That is probably becuase of the search cost increases linearly as the table
grows.
Try the following:
1. Maybe you are using non-case-sensetive string compare. If you are
running on Windows, you may convert every path/file name into uppercase.
2. Use hash table instead of linear search table.
Hint: Look in INIFiles unit, may be THashedStringList is all you need.
Adam Wu
.dlrow eht htiw thgir s'lla ,nevaeh sih ni si doG
From: [EMAIL PROTECTED]
Reply-To: Borland's Delphi Discussion List <[email protected]>
To: [email protected]
Subject: Slowing down in loop
Date: Tue, 26 Jun 2007 14:18:15 +0100
i have an app that has to update two table with pdf files from
directories. There are about 900 files in one Dir and about 3000 in the
other. I have to check if each file is in the table if not add it. This
requires 3000 searches on the table but as the app progresses it slows
down to a crawl. Anybody have any ideas?.
I have to add to this the revers for deleted files, so I really could do
with speeding up the loop.
The list below is the milliseconds it takes to do 100 hundred records.
There are no updates in the trimmings just locates
bob Pointon
======================================
IPACTA_TRIALS_PDFS
0
109
203
266
328
500
531
610
======================================
IPACTA_LABELS_PDFS
0
110
297
250
328
422
578
579
718
750
813
937
1000
1063
1094
1250
1328
1406
1453
1516
1578
1718
2047
1907
1875
2031
2032
2187
2250
2344
2406
***********************************************************************
NOTICE: This e-mail transmission, and any documents, files or previous
e-mail messages attached to it, may contain confidential or privileged
information. If you are not the intended recipient, or a person
responsible for delivering it to the intended recipient, you are
hereby notified that any disclosure, copying, distribution or use of
any of the information contained in or attached to this message is
STRICTLY PROHIBITED. If you have received this transmission in error,
please immediately notify the sender and delete the e-mail and attached
documents. Thank you.
***********************************************************************
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi
_________________________________________________________________
与联机的朋友进行交流,请使用 Live Messenger;
http://get.live.com/messenger/overview
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi