Go Perf Contention And Sharding

Reduces Go lock contention by sharding state into N lock-striped shards keyed by hash; shard-count and padding guidance; sync.Map's two optimized use cases vs a sharded map[K]V+Mutex for the general case; per-P counters summed on read; batching to amortize a lock; singleflight to collapse duplicate work. Fires on "reduce lock contention", "shard this map", "sync.Map vs mutex map", "hot mutex", "lock striping". Routes sync.Map API to go-sync-primitives, padding to go-perf-false-sharing, measuring to go-perf-block-mutex-profiles.

ctoth Updated 1 repo stars

File contents

ctoth/golang-skills-plugin commit 4a8892a19e

Frequently asked questions

npx get-skill add ctoth/go-perf-contention-and-sharding