Instead of just throwing these objects after each use, which would only give the garbage collector more work, we stash them in a pool (sync.Pool
). The next time we need something similar, we just grab it from the pool instead of making a new one from scratch.