-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Improve memory allocation behavior by replacing sync.Pool with custom pool implementation #3183
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
Merged
+660
−102
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a91ef60
to
d059840
Compare
jasdel
suggested changes
Mar 5, 2020
37759dd
to
4ea1776
Compare
4ea1776
to
8030ade
Compare
jasdel
approved these changes
Mar 5, 2020
jasdel
reviewed
Mar 9, 2020
…ation growth based on on-going uploads.
…der around new pool allocations and reuse.
…/Put could race each other.
… close, but allows channel to be swapped out
d2a11ba
to
9f426af
Compare
aws-sdk-go-automation
pushed a commit
that referenced
this pull request
Mar 10, 2020
=== ### Service Client Updates * `service/ec2`: Updates service API and documentation * Documentation updates for EC2 * `service/iotevents`: Updates service API and documentation * `service/marketplacecommerceanalytics`: Updates service documentation * Change the disbursement data set to look past 31 days instead until the beginning of the month. * `service/serverlessrepo`: Updates service API and documentation ### SDK Enhancements * `aws/credentials`: Clarify `token` usage in `NewStaticCredentials` documentation. * Related to [#3162](#3162). * `service/s3/s3manager`: Improve memory allocation behavior by replacing sync.Pool with custom pool implementation ([#3183](#3183)) * Improves memory allocations that occur when the provided `io.Reader` to upload does not satisfy both the `io.ReaderAt` and `io.ReadSeeker` interfaces. * Fixes [#3075](#3075)
Merged
aws-sdk-go-automation
added a commit
that referenced
this pull request
Mar 10, 2020
Release v1.29.21 (2020-03-10) === ### Service Client Updates * `service/ec2`: Updates service API and documentation * Documentation updates for EC2 * `service/iotevents`: Updates service API and documentation * `service/marketplacecommerceanalytics`: Updates service documentation * Change the disbursement data set to look past 31 days instead until the beginning of the month. * `service/serverlessrepo`: Updates service API and documentation ### SDK Enhancements * `aws/credentials`: Clarify `token` usage in `NewStaticCredentials` documentation. * Related to [#3162](#3162). * `service/s3/s3manager`: Improve memory allocation behavior by replacing sync.Pool with custom pool implementation ([#3183](#3183)) * Improves memory allocations that occur when the provided `io.Reader` to upload does not satisfy both the `io.ReaderAt` and `io.ReadSeeker` interfaces. * Fixes [#3075](#3075)
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pool Benchmarks
Multi-Part Upload
Expected Buffer Allocations: (72+1)*16 = 1168 MB
Before (sync.Pool)
As shown sync.Pool drastically performs over allocations, 2624 MB. This is over 124% more in allocations!
After
We see that we now allocate the exact amount of expected buffers, 1168 MB.
Performance Comparison