[fpc-pascal] Happy tickets benchmark

Serguei TARASSOV serge at arbinada.com
Sat Feb 20 09:48:10 CET 2016


On 19/02/2016 20:20, fpc-pascal-request at lists.freepascal.org wrote:
> Date: Fri, 19 Feb 2016 14:01:16 +0100
> From: Jonas Maebe<jonas.maebe at elis.ugent.be>
> To: FPC-Pascal users discussions<fpc-pascal at lists.freepascal.org>
> Subject: Re: [fpc-pascal] Happy tickets benchmark
>
> Serguei TARASSOV wrote:
>> >For info, simple loop test like
>> >
>> >    while i < 1000000000 do
>> >      i := i + 1;
>> >
>> >shows that the FPC code is 2 times slower than Delphi 7 and Borland C
>> >5.5 and 4 times slower that C#.
> If that's really all there is in your program, then the C# compiler
> probably replaces that with "i+=1000000000;" (gcc and clang definitely
> will do that, I don't know about Delph 7/Borland C 5.5). This is another
> kind of optimisation that is seldom useful in real world programs
> (normally the loop will also do something useful, in which case you
> can't do that).
MSVC does (hence I didn't include it) but all previously listed 
compilers don't remove the loop.
The time ratio is about
FPC - 100, Delphi 7, Borland C - 50, C# - 25, MSVC - 0.

So my doubts was about extra-code generation for the loops.

Regards,
Serguei




More information about the fpc-pascal mailing list