3 ms·
At computerenhance.com[0] Casey Muratori shows that memory mapped files actually perform worse at sequential reads, which is the common case for file access. T
by philippta 1y ago
At computerenhance.com[0] Casey Muratori shows that memory mapped files actually perform worse at sequential reads, which is the common case for file access.
That’s because the CPU won’t prefetch data as effectively and has to rely on page faults to know what to read next. With regular, sequential file reads, the CPU can be much smarter and prefetch the next page while the program is consuming the previous one.
[0] https://www.computerenhance.com/p/memory-mapped-files https://www.computerenhance.com/p/memory-mapped-files
- vlovich123 1y agoIo_uring should be outperforming both - you can configure the read ahead optimally, there’s no page faults, and there’s no copies as there is with buffered I/O: [1] https://archive.is/vkdCo https://archive.is/vkdCo
- atombender 1y agoDoes madvise(..., MADV_SEQUENTIAL) not help here?