I tried a different loop using code like

        tbData.Fields[5].asString:=copy(Buffer,22,30);   //name
        tbData.Fields[6].asString:=copy(buffer,52,30);  //desc

And found it was pretty much the same amount of time - that is eliminating
the FieldByName seems to make no appreciable difference.  In this case 66000
records take 36 seconds.  The same procedures on a file with 15000 records
take around 6 seconds, so there is an effect of it slowing down the larger
the datasets get.

John

Hi John

TDatset.FieldByName is slow - and you're repeating it 15,000X5 times.

Much better to declare 5 TField type vars, use TDataSet.FindField or
TDataSet.FieldByName to assign them prior to the loop.

See how you get on.


_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe

Reply via email to