[DUG] Speed of loading a Client DataSet
Toni Brown
Toni.Brown at penrich.com
Thu Dec 6 22:05:25 NZDT 2007
Any indexes on the memory table?
www.penrich.com
PENRICH CAPITAL LTD
PO Box 39-045, Christchurch, New Zealand
Mobile: +64 21 0319794 Ph: +64 3 3602586 Fax: +64 3 3602587
Unauthorised copying, disclosure, distribution or retention of any
confidential and/or privileged information in this email is strictly
forbidden.
-----Original Message-----
From: delphi-bounces at delphi.org.nz [mailto:delphi-bounces at delphi.org.nz]
On Behalf Of John Bird
Sent: Thursday, 6 December 2007 9:16 p.m.
To: delphi at moorhouse.net.nz; 'NZ Borland Developers Group - Delphi List'
Subject: RE: [DUG] Speed of loading a Client DataSet
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 at delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject:
unsubscribe
More information about the Delphi
mailing list