3 ms·
Interesting! Is there a simple way to measure memory latency?
by d33 7y ago
Interesting! Is there a simple way to measure memory latency?
- dragontamer 7y agoCreate 1-billion 32-bit integers numbers between 0 to 1-billion. Knuth shuffle the integers. "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.
- dlemire 7y agoI suggest using Sattolo’ algorithm instead. Here is a relevant blog post https://lemire.me/blog/2018/11/13/memory-level-parallelism-intel-skylake-versus-apple-a12-a12x/ https://lemire.me/blog/2018/11/13/memory-level-parallelism-i...