[fpc-pascal] Happy tickets benchmark

Jonas Maebe jonas.maebe at elis.ugent.be
Fri Feb 19 14:01:16 CET 2016


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

FPC indeed does not implement many of these optimisations, because we 
prefer to spend our time on other things. If you, or anyone else, wants 
to implement transformations for such idioms, you're welcome and we'll 
happily apply your patches if they are implemented as generic node tree 
optimisation passes.


Jonas



More information about the fpc-pascal mailing list