archive/zip: make checksumReader implement io.WriterTo #56742
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Performance
Milestone
We've stumbled upon a case where performance is left on the table in
io.CopyBuffer
when copying from anarchive/zip.checksumReader
to an*os.File
:In this case, profiles [1] show that
buf
is unused, andio.CopyBuffer
ends up allocating in a child call. The allocations take up 8% of cycles in an exemplar of a fast compilation step (which uses an auxiliary Go binary featuring zip files) at our company.We can work around this problem now that we've discovered it using the struct hack mentioned in #16474, but this leaves performance on the table for others that copy from zip files to real files.
[1]:
The text was updated successfully, but these errors were encountered: