Charles KWON OhJun
c5ed5612fb
perf: mmap zero-copy page access — Go-native optimization
Replaced LRU page cache with syscall.Mmap:
- OpenIndex: mmap entire file read-only (MAP_SHARED)
- cachedLoadPage: copy from mmap slice (no syscall per page)
- Close: munmap + file close
- insertKeyBTree: munmap before modify, mmapFile after complete
- remapFile: re-mmap after file size changes
Results on ext4 (50K records):
- SEEK random: 188ms → 138ms (26% improvement)
- SCAN: 35ms → 23ms (34% improvement)
- DUPKEY: 53ms → 41ms (23% improvement)
- INDEX: 180ms (unchanged — per-key insertion, no mmap during build)
Go-native approach:
- syscall.Mmap instead of C-style LRU cache
- OS page cache handles eviction automatically
- Simpler code (60 lines removed, 30 added)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 11:42:44 +09:00
..
2026-04-06 12:21:26 +09:00
2026-04-07 09:22:05 +09:00
2026-04-02 22:33:59 +09:00
2026-04-07 11:42:44 +09:00
2026-04-02 22:33:59 +09:00
2026-03-31 09:41:50 +09:00
2026-03-31 09:41:50 +09:00
2026-04-02 22:33:59 +09:00
2026-03-31 09:41:50 +09:00