Hasty Briefsbeta

Bilingual

Memory Maps (MMAP) Deliver 25x Faster File Access in Go

6 months ago
  • #system-calls
  • #memory-maps
  • #performance
  • System calls are slow due to kernel entry costs.
  • Memory maps allow files to be part of virtual memory, improving disk I/O performance.
  • Memory maps reduce memory pressure and latency by using pointers.
  • Writing to memory maps is inefficient due to page faults and OS overhead.
  • Varnish Cache initially used memory maps for high performance but later switched to more efficient methods.
  • Memory maps can significantly improve performance, as shown by a 25x improvement in a CDB implementation.
  • Benchmarks and examples provided demonstrate the effectiveness and limitations of memory maps.