benchmarking: fix DB read/write counts#10947
Conversation
PR #10802 added `reset_read_write_count()` at the end of commit_db() to prevent warmup operations from appearing in benchmarking results. However, commit_db is called twice: one on_before_start() closure before benchmark, and one after benchmark execution after benchmark. This PR moves read_write_count() call before the post-benchmark commit_db() call.
|
/cmd prdoc --audience runtime_dev --bump patch |
…time_dev --bump patch'
|
All GitHub workflows were cancelled due to failure one of the required jobs. |
|
Tested via Pallet: "pallet_staking_async", Extrinsic: "force_apply_min_commission", Lowest values: [], Highest values: [], Steps: 2, Repeat: 1
Raw Storage Info
========
Storage: `Staking::MinCommission` (r:1 w:0)
Proof: `Staking::MinCommission` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
Storage: `Staking::Validators` (r:1 w:1)
Proof: `Staking::Validators` (`max_values`: None, `max_size`: Some(45), added: 2520, mode: `MaxEncodedLen`)
Median Slopes Analysis
========
-- Extrinsic Time --
Model:
Time ~= 58.33
µs
Reads = 2
Writes = 1
Recorded proof Size = 640
Min Squares Analysis
========
-- Extrinsic Time --
Model:
Time ~= 58.33
µs
Reads = 2
Writes = 1
Recorded proof Size = 640 |
Fair - I was not sure if doing it in a follow-up PR or here, but seems reasonable to do it here. Lemme |
|
/cmd bench --pallet pallet_staking_async --runtime asset-hub-westend |
|
Command "bench --pallet pallet_staking_async --runtime asset-hub-westend" has started 🚀 See logs here |
|
/cmd bench --pallet pallet_conviction_voting --runtime asset-hub-westend |
|
Command "bench --pallet pallet_conviction_voting --runtime asset-hub-westend" has started 🚀 See logs here |
let me add that to the prdoc too 😄 |
This reverts commit 49e7922.
|
Created backport PR for
Please cherry-pick the changes locally and resolve any conflicts. git fetch origin backport-10947-to-stable2512
git worktree add --checkout .worktree/backport-10947-to-stable2512 backport-10947-to-stable2512
cd .worktree/backport-10947-to-stable2512
git reset --hard HEAD^
git cherry-pick -x a78b18a5cc547141bfd5c10eb17593239e1e2509
git push --force-with-lease |
Backport #10947 into `stable2512` from sigurpol. See the [documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md) on how to use this bot. <!-- # To be used by other automation, do not modify: original-pr-number: #${pull_number} --> --------- Co-authored-by: Paolo La Camera <paolo@parity.io> Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Backport paritytech#10947 into `stable2512` from sigurpol. See the [documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md) on how to use this bot. <!-- # To be used by other automation, do not modify: original-pr-number: #${pull_number} --> --------- Co-authored-by: Paolo La Camera <paolo@parity.io> Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
PR #10802 added
reset_read_write_count()at the end of commit_db() to prevent warmup operations from appearing in benchmarking results. However, commit_db is called twice: one onon_before_start()closure before benchmark, and one after benchmark execution after benchmark.This PR whitelists the warmup key used in commit_db so that it doesn't appear in the read/write count.
We also regenerated staking-async weights (wrongly benchmarked in #10802) and conviction-voting to check both v1 and v2 benchmarking.
Driven-by: update
try-runtime-clito v0.10.1 as an attempt to fix the issue for which CI regularly fails in the check-migration (WAH) job in ./try-runtime create-snapshot --uri wss://westend-asset-hub-rpc.polkadot.io:443 snapshot.raw`