[fpc-devel] Benchmark for FreePascal

darekM darekm at emadar.com
Sat Dec 10 22:09:58 CET 2005


Hi
I've tested some of benchmark on 

http://shootout.alioth.debian.org/

I've see that reverse-complement benchmark <http://shootout.alioth.debian.org/benchmark.php?test=revcomp&lang=all> for FPC is very slow. I discover, that problem is with readln, that function consume about 90% of time. Because I use it in my program, I implemented new version of reading files. My propositions is add tTextStream to unit Classes

using is very similar

 while not eof do
    begin
      readln(s);
    end;

changed to
   tx:=tTextStream.create('name')  //or via handle

  while tx.readln(d)>=0 do
  

   tx.free;

My implementation cause than benchmark run 4 times faster. But I think, it  need some improvements.

Is this enough  to add it to Classes. If so, I'll work on it.


Darek



-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: textstream.pas
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20051210/4784aa02/attachment.ksh>


More information about the fpc-devel mailing list