Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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



Io_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


Does madvise(..., MADV_SEQUENTIAL) not help here?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: