This is a bit of a Tuesday micro-blog looking at the performance of various solutions for concurrent map insertion/retrieval in golang.

In particular I’m going to look at three types of Map:

  1. Go’s builtin map type, protected by a read-write mutex (sync/atomic/RWMutex)
  2. Go’s new sync.Map type, which is an optimized scalable concurrent map.
  3. Go’s builtin map type, protected by an elided rw-mutex.