Use sync.Pool
to reduce lengthReader
allocations
#5756
Labels
Milestone
sync.Pool
to reduce lengthReader
allocations
#5756
In #5461 we introduced
lengthReader
to count the amount of bytes read from the request body.We're allocating a new
lengthReader
on each request though (but only requests with a body, so not GETs). This is inefficient, it could be improved by usingsync.Pool
to reuse allocatedlengthReader
structs.The text was updated successfully, but these errors were encountered: