[fpc-devel] Benchmark for FreePascal

darekM darekm at emadar.com
Tue Dec 13 01:33:32 CET 2005


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 at lists.freepascal.org
>http://lists.freepascal.org/mailman/listinfo/fpc-devel
>
>
>  
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: textstream.pas.gz
Type: application/x-gzip
Size: 1050 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20051213/0f585d64/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: project1.pas.gz
Type: application/x-gzip
Size: 1349 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20051213/0f585d64/attachment-0001.bin>


More information about the fpc-devel mailing list