Mangakissa,
Apologies for the delay in responding but other aspects of life get in the way.....
You are correct. I miss-read/understood what I was looking at. A close does clear the count.Thank you.
However the original problem (and why I miss understood things) is still there.
I have the following code
Data.Active := true;
Databuf.Edit;
for ctr := 0 to <input-record-count> do
Begin
Databuf.append;
<move data from input-data[ctr] to Databuf record fields>.AsString
<Log time, ctr, etc>
end;
Databuf.Close;
If I execute the above code the log time stamps show that the loading of 4497 records takes 1-2 seconds. The following log entries show the first three records with a time per record of 0-2 millie seconds per record.
10:13:29:847 AthsDataModule.Loop: 1 0 202549 0
10:13:29:849 AthsDataModule.Loop: 1 1 157224 1
10:13:29:850 AthsDataModule.Loop: 1 2 202501 2
Similar times per record at the end of the input.
10:13:30:718 AthsDataModule.Loop: 1 4494 201967 4494
10:13:30:718 AthsDataModule.Loop: 1 4495 3965 4495
10:13:30:718 AthsDataModule.Loop: 1 4496 203608 4496
If I execute the code a second time things are different. Note the times!
10:14:20:746 AthsDataModule.Loop: 2 0 202549 0
10:14:30:551 AthsDataModule.Loop: 2 1 157224 1
10:14:31:257 AthsDataModule.Loop: 2 2 202501 2
Ten seconds for the first record, about 700 for the second
Things are consistently slow as the record count increases with each record taking around 65 millie seconds compared to around 1 for the first load.
10:18:57:970 AthsDataModule.Loop: 2 4490 200786 4490
10:18:58:035 AthsDataModule.Loop: 2 4491 203276 4491
10:18:58:103 AthsDataModule.Loop: 2 4492 203055 4492
10:18:58:169 AthsDataModule.Loop: 2 4493 203599 4493
10:18:58:234 AthsDataModule.Loop: 2 4494 201967 4494
10:18:58:300 AthsDataModule.Loop: 2 4495 3965 4495
10:18:58:361 AthsDataModule.Loop: 2 4496 203608 4496
Over 4 minutes to process 4497 records. So where is all the time going? What resource is not available? Memory?
I will create a test project and see if I can re-create the problem in that, the current project is to large/complex to upload.
Any suggestions, help appreciated?
Ian