TLDR Web Dev · ARTICLES & TUTORIALS

MEMORY IS SLOW, DISK IS FAST

bitflux.ai24 min read

Summary from the TLDR Web Dev newsletter

Memory is not always faster than disk, as disk I/O can outperform memory caching in specific scenarios. Experiments involving counting integers in a large dataset show that traditional memory access methods like `mmap()` introduce overhead due to memory latency. By using an `io_uring` based I/O engine to stream data directly from disk, faster data processing is achieved compared to accessing data from the page cache.