I can confirm, Inc(); is slower. Change decreased time from 440 to 390 ms.
 
Quick test (empty project in Laz.):
unit1.pas:35                              inc(TicketsCount);
000000000046DB18 4883c001                 add    $0x1,%rax
unit1.pas:36                              TicketsCount+=1;
000000000046DB1C 488d4001                 lea    0x1(%rax),%rax
unit1.pas:37                              TicketsCount:=TicketsCount+1;
000000000046DB20 488d5801                 lea    0x1(%rax),%rbx
______________________________________________________________
Od: Paulo Costa <paco.mail.telepac...@gmail.com>
Komu: <fpc-pascal@lists.freepascal.org>
Datum: 13.02.2016 22:00
Předmět: Re: [fpc-pascal] Happy tickets benchmark

On 13-Feb-16 10:44, Serguei TARASSOV wrote:
Could anyone make the series on Windows with FPC, Delphi and MS .Net?
The test of FPC 3.0 and any other comments are welcome.

On my PC with Windows 8.1, fpc 2.6.4 32bits, when I changed the line:
inc(TicketsCount);
to:
TicketsCount := TicketsCount + 1;

the results improved from:
C:\tmp\tests>HappyTickets.exe
Found 4816030 tickets. Elapsed time, msec: 323

to

C:\tmp\tests>HappyTickets.exe
Found 4816030 tickets. Elapsed time, msec: 262


Paulo Costa
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal 
<http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal>

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to