Tackling Contention: The Monsters Inside the 'sync.Locker'
Go is all about parallelism and concurrency, but they don’t come for free. This talk is about measuring their contention price, and being able to reduce it.
Some light will be shed on ways to measure the computational power wasted waiting. The trace/block and pprof tools and libraries will be explained with actionable examples.
After showing how to find contention issues, some handy ways to address them will be shown: -Splitting work: different ways to change common algorithms to not have a centralized state. -From channels to mutexes: where it makes sense to make the switch, and why. -From mutexes to atomics: the real price of making this step, and how to make an informed choice about it.
