[fpc-pascal] Happy tickets benchmark

Martin fpc at mfriebe.de
Sun Feb 14 13:50:43 CET 2016


On 14/02/2016 12:44, Florian Klämpfl wrote:
> Am 14.02.2016 um 13:34 schrieb Serguei TARASSOV:
>> On 14/02/2016 12:57, fpc-pascal-request at lists.freepascal.org 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
>> As I said, the goal of the test is to compare the compilers,
> The goal, yes.
>
Out of interest, how does the modified code compare with/without the 
"loop invariant" patch?




More information about the fpc-pascal mailing list