3 ms·
Indeed. Memory mapped files are the bubble sort 2.0. They look simple and approachable on the surface, lead to an elegant code and seem to solve the problem in
by eps 6y ago
Indeed. Memory mapped files are the bubble sort 2.0.
They look simple and approachable on the surface, lead to an elegant code and seem to solve the problem in basic test cases, but in practice they have nasty scalability problems. In particular, trying to work with very large files leads to cache thrashing that affects the entire system, which makes mmaped files particularly unfit for implementing off-memory data structures. Moreover, the code has zero control over this behavior, because we ultimately over-allocate memory and outsource swapping details to the OS.