This PR alters the decode logic for maps to avoid reallocations due to map growth from insertions.
By using iterators + collect the size of the allocation required for the IndexMap is known up front, avoiding the need for reallocations as decoded items are inserted to the map.
This should give a small speed up to decoding of produce messages since they use maps.
This PR alters the decode logic for maps to avoid reallocations due to map growth from insertions. By using iterators + collect the size of the allocation required for the IndexMap is known up front, avoiding the need for reallocations as decoded items are inserted to the map.
This should give a small speed up to decoding of produce messages since they use maps.