~/talk

Tackling contention: the monsters inside the `sync.Locker`

Talkat GoWayFest 3.0 2019 Β· on Friday, 2019-07-05Β· [concurrency, go]
slides:none on file

Shows concrete measurement workflows using pprof and trace and the runtime mutex/block profiles to find which lock or cache line eats CPU seconds, with examples where all four seconds of work are spent waiting. Demonstrates fixes that actually reduce contention: shard state to cut contention roughly by the shard count, batch updates to lower synchronization frequency, replacing channels with mutexes for hot paths, and the tradeoffs of atomic compare-and-swap loops and sync.Map (fewer cache hurts, more pointer chasing). Advises measure β†’ change β†’ remeasure.

AI-written summary Β· about

  1. 0:00Introduction to contention
  2. 1:06Measuring contention with tools
  3. 3:36Tracing contention in production
  4. 8:58Understanding measurement costs
  5. 10:51Sharding state to reduce contention
  6. 12:59Batching for performance
  7. 14:25Mutexes vs channels
  8. 16:55Why mutexes are fast
  9. 17:18False sharing in memory
  10. 20:40Read-write mutex pitfalls
  11. 22:06When to use sync.Map
  12. 23:08Atomic operations basics
  13. 25:17ABA problem and risks
  14. 27:48Q&A on atomic usage
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark β€” the status bar button does the same
← β†’
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter β€” or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.