-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
use max-heap to collect shink candidates by byte savings #33731
Conversation
Codecov Report
@@ Coverage Diff @@
## master #33731 +/- ##
=======================================
Coverage 81.8% 81.8%
=======================================
Files 806 806
Lines 217859 217923 +64
=======================================
+ Hits 178239 178296 +57
- Misses 39620 39627 +7 |
How are the performance numbers, before and after? |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable to me, just one nit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. One nit/question.
How do the byte savings look on mnb and/or pop-net? |
Problem
For example, given two storages below:
Storage A: alive = 1, total = 2, alive ratio = 0.5
Storage B: alive = 6, total = 10, alive ratio = 0.6
If we select by ratio, then A will be chosen to shrink, which gives result ratio of 7/11 (0.63).
However, if we select by bytes savings, B will be chosen. This gives the result ratio of 7/8 (0.875).
storages. We could just partially sort the storages before the cutoff (i.e. use a heap).
Summary of Changes
Use max-heap to store and partially sort and select candidate storage for shrinking by bye savings.
Fixes #