[fpc-pascal] Happy tickets benchmark

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


On 19/02/2016 20:20, fpc-pascal-request at lists.freepascal.org wrote:
> Date: Fri, 19 Feb 2016 11:49:57 -0700 (MST) From: leledumbo 
> <leledumbo_cool at yahoo.co.id> To: fpc-pascal at lists.freepascal.org 
> Subject: Re: [fpc-pascal] Happy tickets benchmark
>> >Do you have any ideas why this kind of optimization is special?
> Didn't Florian said that this kind of optimization has no benefit in real
> world programs and will only increase compilation time?
After more than 20 years in software engineering I'm avoiding to use the 
phrases like "real world program" or I put in quotes the word "real" at 
least :)
>
>> >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#.
> Just checked such a code with gcc 5.3.0, in -O2 the generated assembly is:
>
> 	xorl	%eax, %eax
> 	ret
>
> which literally does nothing. Without optimization the speed is equal.
>
It shows that gcc do the same kind of optimization as MSVC (hence I 
didn't include it), but other don't.
See my answer to Jonas for more details.

Regards,
Serguei



More information about the fpc-pascal mailing list