Skip to content

Conversation

@sigurpol
Copy link
Contributor

@sigurpol sigurpol commented Jan 30, 2026

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 on_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.

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.
@sigurpol sigurpol requested a review from a team as a code owner January 30, 2026 13:46
@sigurpol sigurpol added T12-benchmarks This PR/Issue is related to benchmarking and weights. A4-backport-stable2512 Pull request must be backported to the stable2512 release branch labels Jan 30, 2026
@sigurpol
Copy link
Contributor Author

/cmd prdoc --audience runtime_dev --bump patch

@paritytech-workflow-stopper
Copy link

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/21518053752
Failed job name: check-runtime-compatibility

@sigurpol
Copy link
Contributor Author

Tested via target/release/frame-omni-bencher v1 benchmark pallet --runtime ./target/release/wbuild/asset-hub-westend-runtime/asset_hub_westend_runtime.compact.compressed.wasm --pallet pallet_staking_async --extrinsic "force_apply_min_commission" --steps 2 --repeat 1:

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

Seems we are back on track @mertwole , @ggwpez

Copy link
Contributor

@mertwole mertwole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aldo the pallet-staking-async weights need to be benched again as #10802 removed DB read/write weights there

@sigurpol
Copy link
Contributor Author

Aldo the pallet-staking-async weights need to be benched again as #10802 removed DB read/write weights there

Fair - I was not sure if doing it in a follow-up PR or here, but seems reasonable to do it here. Lemme

@sigurpol
Copy link
Contributor Author

/cmd bench --pallet pallet_staking_async --runtime asset-hub-westend

@github-actions
Copy link
Contributor

Command "bench --pallet pallet_staking_async --runtime asset-hub-westend" has started 🚀 See logs here

@ggwpez
Copy link
Member

ggwpez commented Jan 30, 2026

/cmd bench --pallet pallet_conviction_voting --runtime asset-hub-westend
(to also check V1)

@github-actions
Copy link
Contributor

Command "bench --pallet pallet_conviction_voting --runtime asset-hub-westend" has started 🚀 See logs here

@sigurpol
Copy link
Contributor Author

/cmd bench --pallet pallet_conviction_voting --runtime asset-hub-westend (to also check V1)

let me add that to the prdoc too 😄

…t_staking_async --runtime asset-hub-westend'
@github-actions
Copy link
Contributor

Command "bench --pallet pallet_staking_async --runtime asset-hub-westend" has finished ✅ See logs here

Details

Subweight results:
File Extrinsic Old New Change [%]
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs set_staking_configs_all_remove 8.12us 807.81us +9848.39
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs set_staking_configs_all_set 8.89us 808.74us +8994.13
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs prune_era_stakers_paged 385.92us 12.91ms +3246.41
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs set_validator_count 4.03us 104.21us +2484.65
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs prune_era_stakers_overview 399.79us 10.29ms +2473.77
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs set_min_commission 4.10us 104.17us +2442.02
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs prune_era_claimed_rewards 419.64us 10.30ms +2354.64
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs prune_era_validator_prefs 426.54us 10.29ms +2312.01
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs prune_era_validator_slash_in_era 417.46us 6.42ms +1436.95
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs prune_era_single_entry_cleanups 48.32us 390.82us +708.75
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs kick 2.36ms 18.32ms +677.11
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs deprecate_controller_batch 45.77ms 340.69ms +644.31
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs prune_era_validator_reward 46.04us 289.56us +528.97
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs prune_era_reward_points 46.11us 287.49us +523.44
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs validate 161.42us 958.72us +493.94
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs set_controller 77.23us 450.61us +483.45
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs force_new_era 21.74us 121.48us +458.86
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs force_new_era_always 22.01us 121.86us +453.62
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs force_no_eras 22.65us 121.71us +437.30
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs bond 162.70us 698.54us +329.35
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs restore_ledger 114.86us 460.28us +300.75
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs withdraw_unbonded_update 181.11us 651.04us +259.48
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs set_payee 61.30us 210.17us +242.84
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs rc_on_offence 57.11ms 190.77ms +234.03
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs update_payee 75.53us 249.44us +230.23
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs force_apply_min_commission 67.31us 207.32us +208.01
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs migrate_currency 169.85us 514.30us +202.80
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs apply_slash 34.48ms 68.47ms +98.58
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs payout_stakers_alive_staked 37.56ms 63.48ms +69.00
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs chill 5.96ms 7.07ms +18.53
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs cancel_deferred_slash 3.08ms 3.37ms +9.57
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs unbond 10.29ms 11.11ms +8.05
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs force_unstake 16.18ms 15.21ms -5.97
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs withdraw_unbonded_kill 14.83ms 13.82ms -6.82
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs process_offence_queue 12.92ms 11.99ms -7.25
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs rebond 10.70ms 9.52ms -11.06
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs bond_extra 13.18ms 11.16ms -15.28
Command output:

✅ Successful benchmarks of runtimes/pallets:
-- asset-hub-westend: ['pallet_staking_async']

…t_conviction_voting --runtime asset-hub-westend'
@github-actions
Copy link
Contributor

Command "bench --pallet pallet_conviction_voting --runtime asset-hub-westend" has finished ✅ See logs here

Details

Subweight results:
File Extrinsic Old New Change [%]
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_conviction_voting.rs vote_new 812.15us 4.94ms +508.79
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_conviction_voting.rs unlock 510.44us 619.20us +21.31
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_conviction_voting.rs remove_other_vote 245.94us 260.52us +5.93
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_conviction_voting.rs undelegate 88.55ms 71.21ms -19.58
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_conviction_voting.rs delegate 89.13ms 71.45ms -19.84
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_conviction_voting.rs vote_existing 1.01ms 767.90us -24.08
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_conviction_voting.rs remove_vote 704.98us 432.34us -38.67
Command output:

✅ Successful benchmarks of runtimes/pallets:
-- asset-hub-westend: ['pallet_conviction_voting']

@sigurpol sigurpol enabled auto-merge January 31, 2026 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A4-backport-stable2512 Pull request must be backported to the stable2512 release branch T12-benchmarks This PR/Issue is related to benchmarking and weights.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants