Hi
 My CPU war
Welcome to the CPU war for StrLoadFile.. Please wait...

test 1 (char) execution time: 1862654
test 2 (blockread 1) execution time: 27080
test 3 (blockread fsize) execution time: 46633
test 7 (blockread tHandle) execution time: 18569
test 4 (tStringList) execution time: 364999
test 1 ln (tTextStream) execution time: 117256
test 2 ln (readln) execution time: 182298

Done.

Comment:
use Athlon 2.6G +Gentoo

test 7 : read file via tFileStream -- this is the fastest way to read file



test 2 ln : read file line by line used: readln and eof
test 1 ln: read file line by line used tTextStream



Darek

---------------------------------------------------------
Welcome to the CPU war for StrLoadFile.. Please wait...

test 1 execution time: 9357464  <-- char by char
test 2 execution time: 257074   <-- my blockread
test 3 execution time: 265960   <-- my other blockread
test 4 execution time: 2666055  <-- classes stringlist
test 5 execution time: 9133218  <-- char w/buffer

Done.
Press <enter> to exit
--------------------------------------------------------

In this case, the 100,000 buffer helped a little, but not too significant.

I think stringlist.loadfile should use block reading rather than the overhead of
using streams. We've got way too much overhead with stringlists using classes 
on top
of classes on top of classes. Although the current stringlist.loadfile is much 
faster
than char by char, block reading still beats it hands down.

Now as for Delphi's stringlist.loadfile and stringlist.text, I will have to do 
some
tests and see.

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel



Attachment: textstream.pas.gz
Description: GNU Zip compressed data

Attachment: project1.pas.gz
Description: GNU Zip compressed data

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to