Skip to content

Remove reader allocation for compressors pools#792

Merged
emcfarlane merged 1 commit intomainfrom
ed/noBodyCompressors
Oct 28, 2024
Merged

Remove reader allocation for compressors pools#792
emcfarlane merged 1 commit intomainfrom
ed/noBodyCompressors

Conversation

@emcfarlane
Copy link
Contributor

Small optimization to avoid allocating a new reader when recycling compressors by using http.NoBody.

Small optimization to avoid allocating a new reader when recycling
compressors by using `http.NoBody`.

Signed-off-by: Edward McFarlane <emcfarlane@buf.build>
@emcfarlane emcfarlane requested a review from jhump October 28, 2024 15:27
// also reset the decompressor when it's pulled out of the pool, we can
// ignore errors here.
_ = decompressor.Reset(strings.NewReader(""))
_ = decompressor.Reset(http.NoBody)
Copy link
Contributor

Choose a reason for hiding this comment

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

😻 Love the attention to detail here.

@emcfarlane emcfarlane merged commit 74a6754 into main Oct 28, 2024
@emcfarlane emcfarlane deleted the ed/noBodyCompressors branch October 28, 2024 17:29
@emcfarlane emcfarlane mentioned this pull request Jan 7, 2025
emcfarlane added a commit that referenced this pull request Jan 7, 2025
Below are the draft notes for the release:

----

# v1.18.0

## What's Changed
### Enhancements
* Add `package_suffix` option to `protoc-gen-connect-go` to allow
specifying the output directory of generated code by @bufdev and
@emcfarlane in #803
* Change stream client closures to be non-blocking by @emcfarlane in
#791
### Other changes
* Fix comment typo spelling of optimize by @yoshihiro-shu in
#786
* Remove reader allocation for compressors pools by @emcfarlane in
#792

## New Contributors
* @yoshihiro-shu made their first contribution in
#786

**Full Changelog**:
v1.17.0...v1.18.0

Signed-off-by: Edward McFarlane <emcfarlane@buf.build>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants