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

Parallelize gzip compression #1293

Merged
merged 78 commits into from
Apr 6, 2023
Merged

Parallelize gzip compression #1293

merged 78 commits into from
Apr 6, 2023

Conversation

StephenButtolph
Copy link
Contributor

Why this should be merged

It's weird that we can't (de)compress messages concurrently.

How this works

Removes shared state.

How this was tested

CI + benchmarking

@StephenButtolph StephenButtolph added this to the v1.10.0 (Cortina) milestone Apr 5, 2023
@StephenButtolph StephenButtolph added the networking This involves networking label Apr 5, 2023
Base automatically changed from add-zstd-compression to dev April 5, 2023 23:47
g.bytesReader.Reset(msg)
if err := g.gzipReader.Reset(g.bytesReader); err != nil {
bytesReader := bytes.NewReader(msg)
gzipReader, err := gzip.NewReader(bytesReader)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems we could pool the gzipReader too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We benchmarked it - the overhead of the sync pool for the reader is more than the savings for the allocation.

@StephenButtolph StephenButtolph changed the title Simplify gzip compression Parallelize gzip compression Apr 6, 2023
@StephenButtolph StephenButtolph merged commit 81db35b into dev Apr 6, 2023
@StephenButtolph StephenButtolph deleted the simplify-gzip-compression branch April 6, 2023 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Code quality improvement networking This involves networking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants