-
Notifications
You must be signed in to change notification settings - Fork 259
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
Runs accounts delta hash calculation in thread pool #3389
Runs accounts delta hash calculation in thread pool #3389
Conversation
Backports to the beta branch are to be avoided unless absolutely necessary for fixing bugs, security issues, and perf regressions. Changes intended for backport should be structured such that a minimum effective diff can be committed separately from any refactoring, plumbing, cleanup, etc that are not strictly necessary to achieve the goal. Any of the latter should go only into master and ride the normal stabilization schedule. Exceptions include CI/metrics changes, CLI improvements and documentation updates on a case by case basis. |
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 - thanks for grabbing this one!
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
Merging this one so it is ready for the backport meeting 😸 |
(cherry picked from commit ffd261e)
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.
…#3389) (#3391) Runs accounts delta hash calculation in thread pool (#3389) (cherry picked from commit ffd261e) Co-authored-by: Brooks <[email protected]>
Problem
In Bank::freeze() we calculate the accounts delta hash for the slot. This is in the critical path, so we do the delta hash calc in parallel. Since an explicit thread pool is not specified, the delta hash calc ends up running in the global thread pool. This may not be ideal, if other tasks are running in the global pool (or get added later).
There is already a thread pool for foreground tasks, so we should use that one here.
h/t to @steviez for bringing this up
Summary of Changes
Run the accounts delta hash calc in the accounts-db foreground thread pool.
Results
Here's metrics from
mce3
andmce4
before and after picking up this change:(Note, mce3 restarted twice, which is why it has two spikes. mce4 only restarted once, hence one spike.)
Comparing pre and post, we see the accounts delta hash time got faster for both machines by quite a noticeable amount! ~1 ms for mce3 and ~0.5 ms for mce4.