With its only remaining field being an embedded bytes.Buffer, there's no reason to retain the
encoderBuffer type.
Signed-off-by: Ben Luddy <bluddy@redhat.com>
Since go 1.18, the reflect package introduces MapIter.SetKey and
MapIter.SetValue that will do fewer memory allocation for map
iteration which is frequently used for CBOR encode operation. Plus,
usage of sync.Pool will further reduce memory allocation by reusing
the shared memory in the pool. Lastly, the Value.SetZero method
(available since go 1.20) is helpful to release memory allocation
to the GC when is no longer needed.
Signed-off-by: Vu Dinh <vudinh@outlook.com>