top | item 47102496

Benchmarking 5 concurrent map implementations in Go (incl. sync.Map)

1 points| puzpuzpuz-hn | 8 days ago |github.com

1 comment

order

puzpuzpuz-hn|8 days ago

Benchmarks for 5 concurrent hash map implementations in Go: sync.Map, xsync.Map, cornelk/hashmap, alphadose/haxmap, and orcaman/concurrent-map.

Workloads: read-heavy to write-heavy (100%/99%/90%/75% reads), with and without warm-up, plus range-under-contention (iteration while a writer mutates the map).

Key types: string and int. Map sizes: 100 to 1M entries. GOMAXPROCS: 1, 4, 8, 12.

Results are in the README with plots and a summary table.

Disclaimer: I'm the author of xsync, one of the libraries benchmarked here. I did my best to keep the benchmark fair. If you spot issues or think another library should be included, please open an issue or PR.