I repeated the floyd()
call 100 times. With the line commented perf stat
gives:
-> TIME 1.334832287s
Performance counter stats for 'target/release/manuel_constanzo':
7298606027 instructions:u # 1,64 insn per cycle (83,15%)
4444943282 cpu-cycles:u (83,37%)
13141385 cache-misses # 13,448 % of all cache refs (83,37%)
97716434 cache-references (83,37%)
307781226 branch-instructions (83,36%)
1030760 branch-misses # 0,33% of all branches (66,53%)
1,756984452 seconds time elapsed
1,634879000 seconds user
0,116490000 seconds sys
with the line uncommented, it gives:
-> TIME 2.084396233s
Performance counter stats for 'target/release/manuel_constanzo':
10248449201 instructions:u # 1,59 insn per cycle (83,23%)
6429701257 cpu-cycles:u (83,36%)
27152737 cache-misses # 10,479 % of all cache refs (83,37%)
259112585 cache-references (83,38%)
410791345 branch-instructions (83,37%)
1035576 branch-misses # 0,25% of all branches (66,52%)
2,503109354 seconds time elapsed
2,352298000 seconds user
0,144509000 seconds sys
It seems to be a combination of more instructions to execute and less instructions per cycle.