Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compress/flate: reduce allocations in init #56218

Open
Thorleon opened this issue Oct 13, 2022 · 3 comments
Open

compress/flate: reduce allocations in init #56218

Thorleon opened this issue Oct 13, 2022 · 3 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Performance
Milestone

Comments

@Thorleon
Copy link
Contributor

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

@gopherbot
Copy link

Change https://go.dev/cl/442895 mentions this issue: compress/flate: reduce allocations in init

@ianlancetaylor
Copy link
Contributor

CC @dsnet

@mvdan
Copy link
Member

mvdan commented Oct 14, 2022

Joe already replied in the CL, so I think the discussion can happen there.

Do we need this issue? The CL already has all the information, and I don't think we need an issue to track this in terms of milestones or labels.

@joedian joedian added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Oct 14, 2022
@seankhliao seankhliao added this to the Unplanned milestone Nov 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Performance
Projects
None yet
Development

No branches or pull requests

7 participants