benchmarks icon indicating copy to clipboard operation
benchmarks copied to clipboard

enh: more realistic benchmark

Open zerothi opened this issue 3 years ago • 4 comments

I think it is vital that benchmarks are realistic. Using fixed size arrays is not realistic in my opinion.

This PR does many things:

  • benchmarks should not rely on convergence, rather a fixed number of iterations is more appropriate, otherwise timings are irrelevant
  • The problem of inconsistent iterations between the C and Fortran versions is fixed. It was an indexing error when calculating the cell for the rhoarr array (C is 0-based, F is 1-based). So they now run the same number of iterations, regardless of M.
  • Moved timings about to make them more comparable.
  • Ensured that all examples now use allocate/malloc
  • Calls in C and F code are much more similar

For running benchmarks it is vital that M is so large that the 2D array goes beyond the L3 cache to match realistic cases.

zerothi avatar Jul 02 '21 17:07 zerothi