Proposal - A benchmark showing slow down on memory reads due to cache misses
Closed this issue · 1 comments
Hey! Thanks for the interesting compilation of topics / benchmarks.
The "Test your CPU's branch predictor with just 10 lines of code." specifically made me recall an experimentation I've conducted couple of years ago to get a real feeling for the hardware specifics (cache line and prefetching, just like branch predictor) that one ought to know if performance is at all a concern.
To test it I enginereed a test of sequential and random access of the elements of a contigeous array
And as one would expect at some point the slow down is considerable and it can also help pinpoint the actual L2 / L3 cache size of my CPU (it was an old i4700k when I measured this originally).
It was a trivial experiment with unsurprising but nonetheless interesting results and in isolation I did not see any point of publishing it. If you find this s of interest for the repo I can integrate the same benchmark for less_slow.cpp.
Sure, that sounds like a nice addition! Thank you @armmah 🤗


