Interesting! Is there a simple way to measure memory latency?
"Linked list" traverse the integers as follows:
//array is full of 1-billion numbers, randomly sorted
uint32_t idx = 0;
for(int i=0; i<200000000; i++){
idx = array[idx]; // Random traversal
}
Pull out a stopwatch (or use Linux's "time" functionality). Divide the time by 200000000. You've now measured memory latency.Here is a relevant blog post https://lemire.me/blog/2018/11/13/memory-level-parallelism-i...