[fpc-devel] Benchmark for FreePascal
Jonas Maebe
jonas.maebe at elis.ugent.be
Wed Dec 14 18:36:37 CET 2005
On 14 dec 2005, at 18:33, Marc Weustink wrote:
>> 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.
>
> Another speed improvement will be disabling IO checks for write, {$I-}
That code only takes 0.5% of the time, not really relevant.
Jonas
PS: my "negligible" above was an overstatement, the readln code takes
up 8.4% of the time. Still a far cry from 90% though.
More information about the fpc-devel
mailing list