[fpc-pascal] Happy tickets benchmark

Serguei TARASSOV serge at arbinada.com
Sun Feb 14 13:34:08 CET 2016


On 14/02/2016 12:57, fpc-pascal-request at lists.freepascal.org wrote:
> Date: Sun, 14 Feb 2016 12:09:42 +0100 (CET) From: Michael Van Canneyt 
> <michael at freepascal.org> To: FPC-Pascal users discussions 
> <fpc-pascal at lists.freepascal.org> Subject: Re: [fpc-pascal] Happy 
> tickets benchmark On Sun, 14 Feb 2016, Florian Klaempfl wrote:
>>
>> >In this case even fpc -h would have helped:)
>> >
>> >But actually, before bothering randomly with command line options, I
>> >would just rewrite the inner loop. Something like
>> >              for n7 := 0 to 9 do
>> >                if n1 + n2 + n3 + n4 - n5 - n6 - n7 in [0..9] then
>> >                  Inc(TicketsCount);
>> >should be much better.
> To back up Florian with numbers:
>
> No in:
> Found 4816030 tickets. Elapsed time, msec: 171
>
> Using in:
> Found 4816030 tickets. Elapsed time, msec: 23
>
> Michael.
As I said, the goal of the test is to compare the compilers, not the 
programmer's intelligence.
You should remove inner loop from C and C# code to get a meaningful result.

Regards,
Serguei



More information about the fpc-pascal mailing list