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

Decouple estimation from providing items and allow allocating a specific size #3

Merged
merged 7 commits into from
Oct 27, 2024

Conversation

diegommm
Copy link
Owner

@diegommm diegommm commented Oct 27, 2024

See commit log

- Split PoolItemProvider into ItemProvider and Estimator
- ItemProvider should now return items of the specified size, and also
reset items for reuse
- Change the size logic to work on capacity instead of length
- The EstimatorStats struct allows backwards compatibility with already
written Estimator implementations
- Hide AdaptivePool and ReaderBufferer for now, which might be re-written
- AdaptivePool: add a GetWithSize method that will get an item from the
sync.Pool and return it if it has at least the requested size, or otherwise
drop it and allocate a new object with that size instead
- ReaderBufferer: allow specifying the size of the preallocated buffer
@diegommm diegommm changed the title Diegommm/add reader bufferer to readme Decouple estimation from providing items and allow allocating a specific size Oct 27, 2024
Copy link

codecov bot commented Oct 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (1a57b3a) to head (0684624).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main        #3   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines          227       240   +13     
=========================================
+ Hits           227       240   +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@diegommm diegommm merged commit 3b2b5cb into main Oct 27, 2024
8 checks passed
@diegommm diegommm deleted the diegommm/add-reader-bufferer-to-readme branch October 27, 2024 23:57
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.

1 participant