[DUG] Speed of loading a Client DataSet
Kyley Harris
kyleyharris at gmail.com
Thu Dec 6 15:43:40 NZDT 2007
ClientDataset is terribly slow sometimes.
I am using a Virtual Memory Table called TVirtualTable which came with SDAC
from crlabs
I was able to run a Query on a middle tier that loaded 40,000 items of about
20 fields into a virtual table,
stream the virtual table to a string, send it over a tcp socket on
localhost, reconvert stringstream back to a virtual table and display it.
Total time was 4 seconds. (in a virtual machine)
On Dec 6, 2007 3:35 PM, John Bird <johnkbird at paradise.net.nz> wrote:
> I want to use TClientDataSet for data that is NOT in a database.
>
> Just reading the data from a file, eg for 15000 records, takes much less
> than a second, but reading the data and inserting several fields into a
> client dataset in a simple loop takes a lot longer, eg 6 seconds or more
> for
> the same 15000 records.
>
> The code I am using is like:
>
> with tbData do
> begin
> append;
> fieldbyname('FieldName1').asInteger:=Number1;
> fieldbyname('FieldName2').asInteger:=Number2;
> fieldbyname('FieldName3').asInteger:=Number3;
> fieldbyname('Name').asString:=Name;
> fieldbyname('Desc').asString:=Desc;
> post;
> end;
>
> I would like to speed this up, as I have seen that reading similar data
> from
> a Database eg with a query is much faster. Any suggestions to speed this
> up?
>
> I already have lines in such as
>
> tbdata.DisableControls;
> tbdata.EnableControls;
>
> Before and after I start reading the data to stop screen updates....
>
> John
>
>
> _______________________________________________
> 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
>
--
Kyley Harris
Harris Software
+64-21-671-821
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20071206/33a689f0/attachment.html
More information about the Delphi
mailing list