Hacker News new | ask | show | jobs
by eloff 2066 days ago
Yes, of course. What I mean to say is that it's weird the author did not see that trend and test it. There wouldn't have been an article if the result was "mmap is faster than read using buffer size < 64kb". It seems kind of central to their whole thesis.
1 comments

Ah, I see your point.

Here's the catch: Large buffer sizes only increase efficiency for sequential reads. mmap() is still much faster for random access within a file. Doubly so, because we need to not just read() but also lseek() for every read.

The inefficiencies of read() can be minimized in the sequential case only.