-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
ShrinkCandidates only holds slot #33173
Conversation
cc8b30c
to
c4e5848
Compare
Codecov Report
@@ Coverage Diff @@
## master #33173 +/- ##
=========================================
- Coverage 82.1% 82.1% -0.1%
=========================================
Files 785 785
Lines 211205 211194 -11
=========================================
- Hits 173473 173420 -53
- Misses 37732 37774 +42 |
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.
Great idea!
fyi, had to rebase against the other pr that just went in. The goal of the other one was to reduce the # line changes in this one and get rid of noisy useless changes. |
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.
lgtm
let Some(store) = self.storage.get_slot_storage_entry(*slot) else { | ||
continue; | ||
}; |
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.
👍
Problem
Improving startup time.
Now that we only have 1 storage per slot, it is more efficient to not hold an
Arc
to the append vec in the shrink list.During index generation, especially with incremental snapshots, we can end up with say 60M duplicate pubkeys across all 432k slots. This results in a lot of record keeping and inefficient
HashMap
stuffing of almost every(Slot, Arc<AppendVec>)
. Getting the append vecs is not fast. They can be looked up in the bg thread by shrink itself. A slot is sufficient to request a shrink.Summary of Changes
Just hold a
HashSet<Slot>
instead of aHashMap<Slot, Arc<AppendVec>>
Fixes #