TLDR Web Dev · MISCELLANEOUS

HOW MUCH SLOWER IS RANDOM ACCESS, REALLY?

samestep.com10 min read

Summary from the TLDR Web Dev newsletter

There is a performance difference between summing array elements in sequential order versus random order. Experiments were conducted on both a MacBook Pro and a Linux desktop, showing that random access becomes much slower as array sizes exceed cache and RAM capacity, with a 4-16x slowdown observed within RAM limits, and a more drastic slowdown when exceeding RAM on Linux. The standard shuffle algorithm is inefficient for large datasets.