2 ms·
If you are just trying to get along and make your program work, there's nothing morally wrong with mmap, but it is far from optimal and optimality is where the
by jeffbee 3y ago
If you are just trying to get along and make your program work, there's nothing morally wrong with mmap, but it is far from optimal and optimality is where the interesting discussions happen. Making the kernel deal with your magic page tables, and asking it to infer what to evict, what to read ahead of time are not the best approach. The page fault cost did not matter much when they invented mmap, back when disk accesses took tens of milliseconds. Today it matters a great deal. Using `fio` on my system, mmap is the slowest way to access the SSD.