opensearch-project / opensearch-go

Go Client for OpenSearch
https://opensearch.org/docs/latest/clients/go/
Apache License 2.0
197 stars 102 forks source link

[ISSUE-520] Pool gzip compressor and buffer used in gzip writer #521

Closed pakio closed 5 months ago

pakio commented 5 months ago

Description

Changed to pool gzip.Writer object and bytes.Buffer object used for gzip compression, for the better performance.

Issues Resolved

Closes https://github.com/opensearch-project/opensearch-go/issues/520

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.

pakio commented 5 months ago

I will update changelog once the change is finalized. Also I'm not very sure how can I address the error in the Lint check, it seems like detecting error somewhere I didn't updated.

dblock commented 5 months ago

I will update changelog once the change is finalized. Also I'm not very sure how can I address the error in the Lint check, it seems like detecting error somewhere I didn't updated.

Rebase, we may have fixed this elsewhere since the main build is green.

codecov[bot] commented 5 months ago

Codecov Report

Attention: Patch coverage is 83.87097% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 66.21%. Comparing base (06a6dc8) to head (0d39036). Report is 6 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #521 +/- ## ========================================== + Coverage 57.29% 66.21% +8.92% ========================================== Files 315 364 +49 Lines 9823 8587 -1236 ========================================== + Hits 5628 5686 +58 + Misses 2902 1589 -1313 - Partials 1293 1312 +19 ``` | [Flag](https://app.codecov.io/gh/opensearch-project/opensearch-go/pull/521/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project) | Coverage Δ | | |---|---|---| | [integration](https://app.codecov.io/gh/opensearch-project/opensearch-go/pull/521/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project) | `59.53% <83.87%> (+8.69%)` | :arrow_up: | | [unit](https://app.codecov.io/gh/opensearch-project/opensearch-go/pull/521/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project) | `81.66% <83.87%> (+68.82%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/opensearch-project/opensearch-go/pull/521?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project) | Coverage Δ | | |---|---|---| | [opensearchtransport/opensearchtransport.go](https://app.codecov.io/gh/opensearch-project/opensearch-go/pull/521?src=pr&el=tree&filepath=opensearchtransport%2Fopensearchtransport.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project#diff-b3BlbnNlYXJjaHRyYW5zcG9ydC9vcGVuc2VhcmNodHJhbnNwb3J0Lmdv) | `86.57% <83.33%> (+1.41%)` | :arrow_up: | | [opensearchtransport/gzip.go](https://app.codecov.io/gh/opensearch-project/opensearch-go/pull/521?src=pr&el=tree&filepath=opensearchtransport%2Fgzip.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project#diff-b3BlbnNlYXJjaHRyYW5zcG9ydC9nemlwLmdv) | `84.00% <84.00%> (ø)` | | ... and [249 files with indirect coverage changes](https://app.codecov.io/gh/opensearch-project/opensearch-go/pull/521/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project)
pakio commented 5 months ago

oh I was about to send some message regarding the change. thanks you @dblock for your review and merging the PR!

dblock commented 5 months ago

Good work @pakio, thank you!