-
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
Add more banking stage benchmarks #24248
Add more banking stage benchmarks #24248
Conversation
@taozhu-chicago Is this something you're interested in reviewing? The main issue I see is that the new benchmarks can take a good while to execute. test::Bencher seems to run each function at least 300 times, meaning something that takes 400ms per iteration takes 120s to benchmark. |
Thanks for adding these benchmarks, happy to look at it, maybe later today. Just a thought (without looking into details), would these scenarios fit better in |
Hah, I didn't know about banking_bench, will take a look tomorrow. |
Actually, it looks better to add benches here as is |
Are you sure? I was about to port things to banking-bench because that seemed more flexible and I wouldn't need to put all the permutations of options into the code. Do you disagree and would prefer to have it stay like this? |
I prefer banking-bench as well actually. |
0338c9a
to
4e687dc
Compare
@sakridge @taozhu-chicago I've redone this PR to target banking-bench instead. Fresh reviews will be appreciated (note that I'm on vacation the next week) |
- Add write-lock-contention option, replacing same_payer - write-lock-contention also has a same-batch-only value, where contention happens only inside batches, not between them - Rename num-threads to batches-per-iteration, which is closer to what it is actually doing. - Add num-banking-threads as a new option - Rename packets-per-chunk to packets-per-batch, because this is closer to what's happening; and it was previously confusing that num-chunks had little to do with packets-per-chunk. Example output for a iterations=100 and a permutation of inputs: contention,threads,batchsize,batchcount,tps none, 3,192, 4,65290.30 none, 4,192, 4,77358.06 none, 5,192, 4,86436.65 none, 3, 12,64,43944.57 none, 4, 12,64,65852.15 none, 5, 12,64,70674.37 same-batch-only,3,192, 4,3928.21 same-batch-only,4,192, 4,6460.15 same-batch-only,5,192, 4,7242.85 same-batch-only,3, 12,64,11377.58 same-batch-only,4, 12,64,19582.79 same-batch-only,5, 12,64,24648.45 full, 3,192, 4,3914.26 full, 4,192, 4,2102.99 full, 5,192, 4,3041.87 full, 3, 12,64,11316.17 full, 4, 12,64,2224.99 full, 5, 12,64,5240.32
4e687dc
to
d3744d1
Compare
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
if !same_payer { | ||
new.message.account_keys[0] = solana_sdk::pubkey::new_rand(); | ||
} | ||
new.message.account_keys[1] = solana_sdk::pubkey::new_rand(); |
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.
+1 for replacing same_payer
with contention on to account
Codecov Report
@@ Coverage Diff @@
## master #24248 +/- ##
=========================================
+ Coverage 81.8% 82.0% +0.1%
=========================================
Files 581 580 -1
Lines 158312 161287 +2975
=========================================
+ Hits 129518 132271 +2753
- Misses 28794 29016 +222 |
* banking-bench: Migrate to clap 3.1.8 (cherry picked from commit 2c7699e) # Conflicts: # Cargo.lock * banking-bench: Add and rearrange options - Add write-lock-contention option, replacing same_payer - write-lock-contention also has a same-batch-only value, where contention happens only inside batches, not between them - Rename num-threads to batches-per-iteration, which is closer to what it is actually doing. - Add num-banking-threads as a new option - Rename packets-per-chunk to packets-per-batch, because this is closer to what's happening; and it was previously confusing that num-chunks had little to do with packets-per-chunk. Example output for a iterations=100 and a permutation of inputs: contention,threads,batchsize,batchcount,tps none, 3,192, 4,65290.30 none, 4,192, 4,77358.06 none, 5,192, 4,86436.65 none, 3, 12,64,43944.57 none, 4, 12,64,65852.15 none, 5, 12,64,70674.37 same-batch-only,3,192, 4,3928.21 same-batch-only,4,192, 4,6460.15 same-batch-only,5,192, 4,7242.85 same-batch-only,3, 12,64,11377.58 same-batch-only,4, 12,64,19582.79 same-batch-only,5, 12,64,24648.45 full, 3,192, 4,3914.26 full, 4,192, 4,2102.99 full, 5,192, 4,3041.87 full, 3, 12,64,11316.17 full, 4, 12,64,2224.99 full, 5, 12,64,5240.32 (cherry picked from commit d2c6c04) * attempt to fix `banking_bench` build, make it same as `dos` Co-authored-by: Christian Kamm <[email protected]> Co-authored-by: Tao Zhu <[email protected]>
These cover different batch sizes and account lock contention scenarios.
Some initial measurements for a different number of non-vote banking stage threads:
After review feedback the PR was adjusted to improve banking-bench instead:
contention happens only inside batches, not between them
it is actually doing.
to what's happening; and it was previously confusing that num-chunks
had little to do with packets-per-chunk.
Example output for a iterations=100 and a permutation of inputs:
Problem
Banking stage benchmarks cover only cases without account lock contention and one batch size.
Summary of Changes
Add benchmarks.