-
Notifications
You must be signed in to change notification settings - Fork 254
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
Test add stake program benches #3396
Test add stake program benches #3396
Conversation
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.
@KirillLykov @ksolana This is the first stab of benching for all stake
instructions. (Well, there is one instruction that is deprecated, that one is not covered.) Just putting it out, so you can take a peek before our next sync-up. It approves feasibility, but I'd love to hear your thoughts on if it's scalable to other programs, or if the structure is suitable for long term. @ksolana mentioned picking right bench harness, which is good point.
The result from my laptop:
Running benches/stake.rs (target/release/deps/stake-4b9e51079ccdcc7c)
running 21 tests
test bench_authorize_staker ... bench: 8,069.97 ns/iter (+/- 136.14)
test bench_authorize_staker_checked ... bench: 8,131.99 ns/iter (+/- 200.29)
test bench_authorize_staker_checked_with_seed ... bench: 8,565.11 ns/iter (+/- 179.96)
test bench_authorize_staker_with_seed ... bench: 8,678.42 ns/iter (+/- 128.38)
test bench_authorize_withdrawer ... bench: 8,391.94 ns/iter (+/- 148.35)
test bench_authorize_withdrawer_checked ... bench: 8,350.21 ns/iter (+/- 115.06)
test bench_authorize_withdrawer_checked_with_seed ... bench: 8,807.82 ns/iter (+/- 197.97)
test bench_authorize_withdrawer_with_seed ... bench: 8,774.39 ns/iter (+/- 632.68)
test bench_deactivate ... bench: 8,461.04 ns/iter (+/- 545.88)
test bench_deactivate_delinquent ... bench: 12,779.42 ns/iter (+/- 702.53)
test bench_delegate_stake ... bench: 11,087.73 ns/iter (+/- 132.47)
test bench_get_minimum_delegation ... bench: 7,873.55 ns/iter (+/- 84.88)
test bench_initialize ... bench: 8,354.89 ns/iter (+/- 140.99)
test bench_initialize_checked ... bench: 8,241.75 ns/iter (+/- 74.91)
test bench_merge ... bench: 9,105.14 ns/iter (+/- 174.68)
test bench_move_lamports ... bench: 9,267.85 ns/iter (+/- 187.89)
test bench_move_stake ... bench: 9,861.28 ns/iter (+/- 282.50)
test bench_set_lockup ... bench: 8,481.72 ns/iter (+/- 523.87)
test bench_set_lockup_checked ... bench: 8,490.35 ns/iter (+/- 288.38)
test bench_split ... bench: 8,864.95 ns/iter (+/- 379.75)
test bench_withdraw ... bench: 8,764.83 ns/iter (+/- 308.53)
test result: ok. 0 passed; 0 failed; 0 ignored; 21 measured; 0 filtered out; finished in 38.32s
3654db0
to
918456b
Compare
commit 918456b tries out Output from dev linux box:
|
commit bafcbf9 tries out "Output from linux dev box"
|
The iai repo is has some bugs, should we for it and use that one? for example i get
Because https://github.com/bheisler/iai/blob/main/src/lib.rs#L195 doesn't check if the |
Added fixes here: https://github.com/ksolana/iai |
Oh boy, less confident to include
wdyt? |
sounds good.
btw, have added fixes to a fork in case we want to use them. It is pretty reliable in terms of the instruction count. As the repo is a bit old, if we use iai, we can maybe fork it (or put it in a |
bafcbf9
to
7f9d316
Compare
7f9d316
to
15352b0
Compare
Clean up this PR to be benchmarking with output details from MacOS
|
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
Problem
Part of #3364, to benchmark each
stake
instructions to determine their static CU consumption.Summary of Changes