Standing on the shoulders of giants
summary
Bigcache is a lock-sharded concurrent map that stores raw bytes and uses a byte-array circular buffer for values so the Go GC scans the heap once, avoiding per-entry pointers. Starting in 2016 it trades generics for speed and claims full GC from 10s to 10ms by upgrading Go and by eliminating allocations: power-of-two shards for a bitwise index (faster in Go 1.14), inlined defer avoidance, custom non-allocating hash, and today a zero-dependency repo that benchmarks faster than groupcache on write-once heavy workloads.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 0:37What is BigCache
- 2:32Performance benchmarks
- 3:37Concurrent hash map basics
- 4:41Sharding the map
- 5:43Bitwise modulo optimization
- 6:29Garbage collector impact
- 7:36Byte view implementation
- 9:06Defer performance
- 9:52Memory allocation costs
- 10:38Dependencies and hash function
- 11:19Summary and future
