[fpc-devel] Benchmark for FreePascal

Jonas Maebe jonas.maebe at elis.ugent.be
Wed Dec 14 18:04:55 CET 2005


On 10 dec 2005, at 22:09, darekM wrote:

> 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.

In my test (Mac OS X/PPC, rtl and program compiled with register  
variables, text buffer of 64kb) readln's overheid is negligible. The  
large cost comes from writeln. The reason the C version is so much  
faster is because its output is buffered as well. We automatically  
flush the output after each writeln (i.e. after each writeln of 60  
characters), while in C this only happens at the very end of the  
program for 128kb of characters at a time.


Jonas



More information about the fpc-devel mailing list