It’s a bit old, but it should still apply. I remember that in general he was annoyed when seeing people recommend mmap instead of read/write for basic I/O usecases.
In general, it’s almost always better to use the specialized API (read, write etc.) instead of reinventing the wheel on your own.
LMDB (and its modern fork MDBX), and kdb+/shakti make incredibly good use of mmap - I suspect it is possible to get similar performance from read(), but probably at 10x the implementation complexity.
https://marc.info/?l=linux-kernel&m=95496636207616&w=2
It’s a bit old, but it should still apply. I remember that in general he was annoyed when seeing people recommend mmap instead of read/write for basic I/O usecases.
In general, it’s almost always better to use the specialized API (read, write etc.) instead of reinventing the wheel on your own.