Wrong average Iter/s using Loop
Rombur opened this issue · 1 comments
Rombur commented
Running the cxx example, I get:
./cxx-example -P loop-report 5000
Loop summary:
------------
Loop Iterations Time (s) Iter/s (min) Iter/s (max) Iter/s (avg)
mainloop 5000 7.045677 373.599004 2382.346651 688.914363
Iteration summary (mainloop):
-----------------
Block Iterations Time (s) Iter/s
0 1192 0.500347 2382.346651
1192 554 0.500597 1106.678626
1746 438 0.500311 875.455467
2184 375 0.500901 748.650931
2559 327 0.501071 652.602126
2886 296 0.501226 590.551967
3182 273 0.501153 544.743821
3455 254 0.500952 507.034606
3709 239 0.500277 477.735335
3948 228 0.501816 454.349802
4176 216 0.501342 430.843616
4392 207 0.502409 412.014912
4599 198 0.500363 395.712713
4797 191 0.500792 381.395869
4988 12 0.032120 373.599004
Since we performed 5000 iterations in 7.045677 seconds, I would expect Iter/s (avg) to be 709.65501257. Instead, we get 688.914363 which is obtained by taking the average of the 15 Iter/s value from Iteration summary
. Note that the same problem can be seen in the documentation, Iter/s (avg) is 713.178697 but Iteration / Time is 713.044405839. The difference in this case is very small but in my code Caliper computes an average of 3.359519 while the correct value is 0.9769