←back to thread

283 points ghuntley | 1 comments | | HN request time: 0.307s | source
1. yencabulator ◴[] No.45140699[source]
> Memory is slow, Disk is fast - Part 2.

Bullshit clickbait title. More like "naive algorithm is slower than prefetching". Hidden at the end of the article:

  >  Memory is slow - when you use it oldschool.
  >  Disk is fast - when you are clever with it.
The author spent a lot of time benchmarking a thing completely unrelated to the premise of the article. And the only conclusion to be drawn from the benchmark is utterly unsurprising.

---

Linux mmap behavior has two features that can hurt, but this article does not deliver that sermon well. Here's what to worry about with mmap:

- for reads, cache misses are unpredictable, and stall more expensive resources than an outstanding io_uring request - for writes, the atomicity story is very hard to get right, and unpredictable writeback delay stalls more expensive resources than an outstanding io_uring request (very few real world production systems with durability write through mmap; you can use conventional write APIs with read-side mmap)