compress/flate: reduce allocations in init #56218
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Performance
Milestone
compress/flate creates in initialization runtime two hcode slices for the following encoders: fixedLiteralEncoding and fixedOffsetEncoding.
It could be replaced with static version created by go generate.
Even the binary size is smaller, as we don't need to include code for hcode slice generation.
Also, errWriterClosed usage may be replaced with a non-allocating version.
old:
init compress/flate @0.84 ms, 0.030 ms clock, 4256 bytes, 8 allocs
new:
init compress/flate @0.68 ms, 0.012 ms clock, 2608 bytes, 3 allocs
The text was updated successfully, but these errors were encountered: