[fpc-pascal] [CPU war] Speed question for strings
    L505 
    fpc505 at z505.com
       
    Sun Nov 20 03:49:56 CET 2005
    
    
  
Which is faster, reading a file Character by Character, by Memory Block, or by
StringList.text?
--------------------------------------------------------
Welcome to the CPU war for StrLoadFile.. Please wait...
test 1 execution time: 9356007 <-- char by char
test 2 execution time: 259683  <-- blockread 1
test 3 execution time: 261501  <-- blockread 2
test 4 execution time: 2640901 <-- stringlist
Done.
Press <enter> to exit
--------------------------------------------------------
Celeron 400, Windows 2000
Fastest method seems to be, as predicted, BlockRead. However I thought Test3 would
have been faster.
Download at:
http://z505.com/download/pascal/StrWrap1/StrLoadFile_CpuWar.zip
Note: I sent a 33kb attachment to the mailing list, but message didn't appear to go
through. This email has been resent without the attachment.
    
    
More information about the fpc-pascal
mailing list