[lazarus] Speaking of TMemo and RH9...

Tom Lisjac netdxr at adelphia.net
Wed Apr 16 18:25:07 EDT 2003



I've noticed some significant speed differences between Mandrake 8.2 and
RH9 when loading TMemo from a text file. On RH9, it took 55 seconds for
"memo1.lines.loadfromfile('/tmp/test')" to load 1400 lines like this:

4Suite-0.11.1-13.i386.rpm
abiword-1.0.4-2.i386.rpm
acl-2.2.3-1.i386.rpm
adjtimex-1.13-6.i386.rpm
...

The same binary loaded the same text file on Mandrake 8.2 in 3 seconds.
Both machines are 1.6 Ghz P4's with a gigabyte of ram.

To make the problem go away, I did the file i/o with a separate
stringlist... then assigned the text properties. This loaded and saved
the file instantly on both systems:

 x:=TStringlist.create;
 x.loadfromfile('/tmp/test');
 memo1.text:=x.text
 ...

 x:=TStringlist.create;
 x.text:=memo1.text
 x.savetofile('/tmp/test');
 ...

It works... but I can't help but wonder if there's a more elegant way to
make TMemo go? :)

Best regards,

-Tom










More information about the Lazarus mailing list