4 ms·
For storage engines that prioritize performance and scalability, mmap() is a poor choice. Not only is it slower and less scalable than alternatives but it also
by jandrewrogers 6y ago
For storage engines that prioritize performance and scalability, mmap() is a poor choice. Not only is it slower and less scalable than alternatives but it also has many more edge cases and behaviors you have to consider. Compared to a good O_DIRECT/io_submit storage engine design, which is a common alternative, it isn't particularly close. And now we have io_uring as an alternative too.
If your use case is quick-and-dirty happy path code then mmap() works fine. In more complex and rigorous environments, like database engines, mmap() is not well-behaved.