Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Add runtime-benchmarks for frame-benchmarking#10324

Merged
bkchr merged 6 commits intoparitytech:masterfrom
zjb0807:update-baseline
Nov 30, 2021
Merged

Add runtime-benchmarks for frame-benchmarking#10324
bkchr merged 6 commits intoparitytech:masterfrom
zjb0807:update-baseline

Conversation

@zjb0807
Copy link
Contributor

@zjb0807 zjb0807 commented Nov 22, 2021

Add runtime-benchmarks feature for frame-benchmarking to control baseline benchmarks.

polkadot companion: paritytech/polkadot#4387
cumulus companion: paritytech/cumulus#802

@zjb0807 zjb0807 changed the title update frame/benchmarking/src/baseline.rs Add runtime-benchmarks for frame-benchmarking Nov 22, 2021
@bkchr
Copy link
Member

bkchr commented Nov 22, 2021

What is the reason for this pr?

@zjb0807
Copy link
Contributor Author

zjb0807 commented Nov 22, 2021

What is the reason for this pr?

benchmarks related code should be enabled in #![cfg(feature = "runtime-benchmarks")], otherwise some scenarios will cause pollution.(.e.g --no-default-features --target=wasm32-unknown-unknown)

https://github.com/open-web3-stack/open-runtime-module-library/runs/4281316679?check_suite_focus=true

@bkchr
Copy link
Member

bkchr commented Nov 23, 2021

Why has your bencher the crate imported when the runtime-benchmarks feature is not enabled?

@zjb0807
Copy link
Contributor Author

zjb0807 commented Nov 23, 2021

Why has your bencher the crate imported when the runtime-benchmarks feature is not enabled?

This is a module that imports some methods of frame_benchmarking, not runtime, so there is no runtime-benchmarks feature.
I think the benchmarks related code should be enabled with runtime-benchmarks feature.
@shawntabrizi

@bkchr bkchr added A2-insubstantial Pull request requires no code review (e.g., a sub-repository hash update). B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit labels Nov 24, 2021
@bkchr bkchr requested a review from shawntabrizi November 24, 2021 08:36
@shawntabrizi
Copy link
Member

shawntabrizi commented Nov 26, 2021

Looks like there is a lot more places this needs to be updated?

Just search for "frame-benchmarking"

And also Polkadot + Cumulus companion

@shawntabrizi
Copy link
Member

/benchmark runtime pallet pallet_balances

@parity-benchapp
Copy link

parity-benchapp bot commented Nov 26, 2021

Benchmark Runtime Pallet for branch "update-baseline" with command cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_balances --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/balances/src/weights.rs --template=./.maintain/frame-weight-template.hbs

Results
Pallet: "pallet_balances", Extrinsic: "transfer", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    60.54
              µs

Reads = 1
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    60.54
              µs

Reads = 1
Writes = 1

Pallet: "pallet_balances", Extrinsic: "transfer_keep_alive", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    46.11
              µs

Reads = 1
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    46.11
              µs

Reads = 1
Writes = 1

Pallet: "pallet_balances", Extrinsic: "set_balance_creating", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    27.38
              µs

Reads = 1
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    27.38
              µs

Reads = 1
Writes = 1

Pallet: "pallet_balances", Extrinsic: "set_balance_killing", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    31.86
              µs

Reads = 1
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    31.86
              µs

Reads = 1
Writes = 1

Pallet: "pallet_balances", Extrinsic: "force_transfer", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:2 w:2)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    61.66
              µs

Reads = 2
Writes = 2

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    61.66
              µs

Reads = 2
Writes = 2

Pallet: "pallet_balances", Extrinsic: "transfer_all", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    57.22
              µs

Reads = 1
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    57.22
              µs

Reads = 1
Writes = 1

Pallet: "pallet_balances", Extrinsic: "force_unreserve", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    25.56
              µs

Reads = 1
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    25.56
              µs

Reads = 1
Writes = 1


ERROR: Unable to push ./frame/balances/src/weights.rs

@zjb0807
Copy link
Contributor Author

zjb0807 commented Nov 26, 2021

Looks like there is a lot more places this needs to be updated?

Other places just import the frame-benchmarking without calling the benchmarks in frame-benchmarking, so it does not affect. I can add on if needed.

@zjb0807
Copy link
Contributor Author

zjb0807 commented Nov 27, 2021

gitlab-check-dependent-cumulus error:

the package `parachain-template-runtime` depends on `frame-benchmarking`, with features: `runtime-benchmarks` but `frame-benchmarking` does not have these features.

gitlab-check-dependent-polkadot error:

the package `kusama-runtime` depends on `frame-benchmarking`, with features: `runtime-benchmarks` but `frame-benchmarking` does not have these features.

But the feature is added. And paritytech/polkadot#4387 works on my machine. Is there a problem with CI?

@zjb0807
Copy link
Contributor Author

zjb0807 commented Nov 29, 2021

The Polkadot and Cumulus companion don't execute diener patch. How to fix the problem?

@kianenigma
Copy link
Contributor

CI is broken for now. We either wait or merge later manually. Thanks!

@kianenigma kianenigma removed the A2-insubstantial Pull request requires no code review (e.g., a sub-repository hash update). label Nov 30, 2021
@bkchr bkchr merged commit 20b5492 into paritytech:master Nov 30, 2021
@zjb0807 zjb0807 deleted the update-baseline branch November 30, 2021 14:16
bkchr pushed a commit that referenced this pull request Dec 1, 2021
* update frame/benchmarking/src/baseline.rs

* add runtime-benchmarks feature

* add runtime-benchmarks for frame-benchmarking

* update frame-benchmarking/runtime-benchmarks

* trigger GitHub actions
niklasad1 added a commit that referenced this pull request Dec 2, 2021
niklasad1 pushed a commit that referenced this pull request Dec 2, 2021
* update frame/benchmarking/src/baseline.rs

* add runtime-benchmarks feature

* add runtime-benchmarks for frame-benchmarking

* update frame-benchmarking/runtime-benchmarks

* trigger GitHub actions
chevdor pushed a commit that referenced this pull request Jan 11, 2022
* update frame/benchmarking/src/baseline.rs

* add runtime-benchmarks feature

* add runtime-benchmarks for frame-benchmarking

* update frame-benchmarking/runtime-benchmarks

* trigger GitHub actions
grishasobol pushed a commit to gear-tech/substrate that referenced this pull request Mar 28, 2022
* update frame/benchmarking/src/baseline.rs

* add runtime-benchmarks feature

* add runtime-benchmarks for frame-benchmarking

* update frame-benchmarking/runtime-benchmarks

* trigger GitHub actions
ark0f pushed a commit to gear-tech/substrate that referenced this pull request Feb 27, 2023
* update frame/benchmarking/src/baseline.rs

* add runtime-benchmarks feature

* add runtime-benchmarks for frame-benchmarking

* update frame-benchmarking/runtime-benchmarks

* trigger GitHub actions
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments