3 ms·
The copy hypothesis also doesn't explain the difference between warm and cold start performance, at least for the "random read" case. For warm start, the speed
by sltkr 6y ago
The copy hypothesis also doesn't explain the difference between warm and cold start performance, at least for the "random read" case.
For warm start, the speed for read vs mmap is 3 GB/s vs 6 GB/s (i.e. mmap is 2x faster).
For cold start, that changes to 0.05 GB/s vs 0.25 GB/s (i.e. mmap is 5x faster).
If the only significant difference between read() and mmap() is how data is copied, then shouldn't the performance gap get much smaller in the cold start scenario? After all, you're adding the identical (and pretty large) overhead of reading from disk. Instead, the gap gets much larger. That's strange. (The sequential read case looks more reasonable.)
So there must be something else going on besides more efficient copying with mmap.