GitHub - puzpuzpuz/go-concurrent-map-bench: Benchmarks for concurrent hash map implementations in Go

Hacker News
February 22, 2026
AI-Generated Deep Dive Summary
The article presents a comprehensive benchmark study of various concurrent hash map implementations in Go, comparing their performance across different workloads and conditions. The study evaluates libraries such as `sync.Map` (the standard library), `xsync.Map`, `cornelk/hashmap`, `alphadose/haxmap`, and `orcaman/concurrent-map`. Each implementation is tested under scenarios with varying read/write ratios, map sizes, and key types (strings or integers). The results highlight how different approaches to concurrency handling—such as lock-free operations, sharding, and bucket-based organization—affect performance. This comparison provides valuable insights for developers working on concurrent systems in Go. The benchmarks are conducted using a permille-based operation selection model, simulating real-world workloads with 100%, 99%, 90%, and 75% read percentages, along with corresponding write operations (store and delete). Key factors like map size, key type, and warm-up variants are also tested. For example, `sync.Map` leverages a trie-based structure for efficient reads but may introduce contention during writes, while `xsync.Map` uses bucket-based organization with per-bucket locking, offering better performance in mixed workloads. Meanwhile, `cornelk/hashmap` employs a lock-free approach with sorted linked lists, making it highly efficient under high concurrency but less so at larger scales. The study reveals that no single implementation outperforms all others across every scenario. For instance, `sync.Map` excels in read-heavy workloads due to its lock-free reads and trie structure, while `xsync.Map` shows strong performance in mixed operations thanks to its cooperative resizing and efficient lookups
Verticals
techstartups
Originally published on Hacker News on 2/22/2026