Skip to content

[DO NOT MERGE / INCOMPLETE] staking-async: improve benchmarking / testing benchmark time#10822

Closed
sigurpol wants to merge 8 commits intomasterfrom
sigurpol-test-bench-staking-timing
Closed

[DO NOT MERGE / INCOMPLETE] staking-async: improve benchmarking / testing benchmark time#10822
sigurpol wants to merge 8 commits intomasterfrom
sigurpol-test-bench-staking-timing

Conversation

@sigurpol
Copy link
Copy Markdown
Contributor

@sigurpol sigurpol commented Jan 15, 2026

Remove redundant clear_validators_and_nominators calls from individual benchmarks

Related issue: #10813

@sigurpol sigurpol requested a review from a team as a code owner January 15, 2026 20:25
@sigurpol
Copy link
Copy Markdown
Contributor Author

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

@github-actions
Copy link
Copy Markdown
Contributor

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

…t_staking_async --runtime asset-hub-westend'
@github-actions
Copy link
Copy Markdown
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 chill_other 13.57ms 12.77ms -5.93
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs rebond 13.89ms 12.82ms -7.73
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs force_unstake 20.75ms 18.77ms -9.54
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs nominate 16.33ms 14.47ms -11.40
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs bond_extra 13.85ms 12.14ms -12.31
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs chill 12.05ms 9.08ms -24.63
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_staking_async.rs force_apply_min_commission 1.56ms 185.22us -88.13
Command output:

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

github-merge-queue Bot pushed a commit that referenced this pull request Jan 19, 2026
Fixes timing leaks in benchmarks with large setup operations (e.g.,
clearing 27k staking entries). After bulk deletions are committed, the
first new allocation can trigger memory allocator overhead that leaks
into benchmark timing.

The fix adds a memory allocator warmup step in `commit_db()` that
performs a dummy write/clear cycle to absorb this overhead before timing
starts.

Fix #10798.

Another related issue:
#10813 (rework of
staking benchmarks to avoid massive bulk deletion if not needed. An
example showing the validity of the approach
[here](#10822 (comment))
where we just remove a clear_validators_and_nominators() from one
benchmark and that's enough to go down from ms to microsec)

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@sigurpol sigurpol added T12-benchmarks This PR/Issue is related to benchmarking and weights. R0-no-crate-publish-required The change does not require any crates to be re-published. labels Jan 19, 2026
@sigurpol
Copy link
Copy Markdown
Contributor Author

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

@github-actions
Copy link
Copy Markdown
Contributor

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

@paritytech-workflow-stopper
Copy link
Copy Markdown

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/21140790391
Failed job name: run-frame-omni-bencher

@sigurpol sigurpol changed the title [DO NOT MERGE] staking-async: improve benchmarking / testing benchmark time staking-async: improve benchmarking / testing benchmark time Jan 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor

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

Details

Subweight results:

No changes found.

Command output:

❌ Failed benchmarks of runtimes/pallets:
-- asset-hub-westend: ['pallet_staking_async']

@sigurpol sigurpol marked this pull request as draft January 20, 2026 08:50
@sigurpol sigurpol changed the title staking-async: improve benchmarking / testing benchmark time [DO NOT MERGE / INCOMPLETE] staking-async: improve benchmarking / testing benchmark time Jan 20, 2026
@sigurpol
Copy link
Copy Markdown
Contributor Author

Not needed for the time being - after the main issue with benchmark tool has been fixed.

@sigurpol sigurpol closed this Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

R0-no-crate-publish-required The change does not require any crates to be re-published. T12-benchmarks This PR/Issue is related to benchmarking and weights.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant