↓ Skip to main content

“Barring few exceptions, mmap is 2–6 times faster than system calls.”

Alexandra (Sasha) Fedorovasasha-f.medium.com ↗

The textbook answer is fewer context switches. The profiler says otherwise. Most of the time goes to copying data, and the user-space copy uses AVX while the kernel’s copy routine doesn’t. The kernel is slower at the job it exists to do.