Board index » delphi » Info on BlockReadSize (dedicated to Manuel Algora and Brian Bushay)

Info on BlockReadSize (dedicated to Manuel Algora and Brian Bushay)

Hi all,

Days 13, 14 and 15 of this month, Manuel Algora, Brian Bushay (TeamB)
and me were asking ourselves the difference between set BlockReadSize <>
0 and DisableControls on a TDataSet. This is my test:

A dBase for Windows table with a million records. The table structure is
one field of char of 100 length.

Then i go to the first record to the last record with this code:

(Form1 has only Button1 and Label1 components)

procedure TForm1.Button1Click(Sender: TObject);

var
   nTime: TDateTime;

begin
   Table1.Open;
   Table1.First;
   Table1.DisableControls;  // Line 1
   Table1.BlockReadSize := 1;  // Line 2
   nTime := Now;
   while not Table1.Eof do begin
     Table1.Next;
   end;
   Label1.Caption := FormatDateTime('nn:ss',Now - nTime);
end;

First i comment the line 2 and go:
The time with DisableControls is 27 seconds.

Then i comment line 1 and try with different values of BlockReadSize:

BlockReadSize = 1: 22 seconds
BlockReadSize = 10: 15 seconds
BlockReadSize = 100: 14 seconds
BlockReadSize = 1000: 14 seconds

--
JAM - Reljate y disfruta...

 

Re:Info on BlockReadSize (dedicated to Manuel Algora and Brian Bushay)


Quote
>Days 13, 14 and 15 of this month, Manuel Algora, Brian Bushay (TeamB)
>and me were asking ourselves the difference between set BlockReadSize <>
>0 and DisableControls on a TDataSet. This is my test:

Thanks for sharing those results.
--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:Info on BlockReadSize (dedicated to Manuel Algora and Brian Bushay)


On Thu, 21 Mar 2002 16:57:34 +0100, Jess Avils Martnez

Quote
<jamj...@jazzfree.com> wrote:
>Days 13, 14 and 15 of this month, Manuel Algora, Brian Bushay (TeamB)
>and me were asking ourselves the difference between set BlockReadSize <>
>0 and DisableControls on a TDataSet. This is my test:

I have been out for some days, so could not read your posting until
now. Thanks for the test; it's quite useful!

Manuel Algora
ceni...@wanadoo.es

Other Threads