title: What is the Big O performance of maps in golang?
body: <p>The <a href="https://golang.org/ref/spec#Map_types" rel="nofollow noreferrer">&quot;Map types&quot; section of the go language specification</a> describes the interface and general usage of map types and the <a href="https://blog.golang.org/go-maps-in-action" rel="nofollow noreferrer">&quot;Go maps in action&quot; post on The Go Blog</a> casually mentions hash tables and &quot;fast lookups, adds, and deletes&quot;.</p>
  <p>The <a href="https://go.dev/src/runtime/map.go#L9" rel="nofollow noreferrer">current <code>runtime/map.go</code> source code</a> describes its implementation as a hashtable (which are typically amortized <code>O(1)</code>); however, I don't see any guarantee of performance characteristics (such as Big O performance) in the language specification or other materials.</p>
  <p>Does the go language make any <em>performance</em> guarantees (e.g. constant-time insertion/lookup/deletion) for map types or only <em>interface</em> guarantees?  (Compare to the Java language where <em>interfaces</em> and <em>implementations</em> are clearly separate.)</p>