Skip to content
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

benchmarking-cli: add --list-pallets option #2844

Closed
ggwpez opened this issue Jan 3, 2024 · 5 comments · Fixed by #3395
Closed

benchmarking-cli: add --list-pallets option #2844

ggwpez opened this issue Jan 3, 2024 · 5 comments · Fixed by #3395
Labels
C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK. D0-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder. T12-benchmarks This PR/Issue is related to benchmarking and weights.

Comments

@ggwpez
Copy link
Member

ggwpez commented Jan 3, 2024

We often copy&paste a specific piece of bash code, á la:

local pallets=($(
    ./target/production/polkadot benchmark pallet --list  |\
      --chain=/path/to/chain-spec.json |\
      tail -n+2 |\
      cut -d',' -f1 |\
      sort |\
      uniq
))

Would be better to have a --list-pallets that deduplicates, sorts and lists them.

@ggwpez ggwpez added C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. D0-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder. labels Jan 3, 2024
@bkchr
Copy link
Member

bkchr commented Jan 4, 2024

IMO we should also support running benchmark all-pallets or whatever it is called. Not sure why we don't have this :P

@dastansam
Copy link
Contributor

hey @ggwpez

I would like to work on this

@ggwpez
Copy link
Member Author

ggwpez commented Jan 4, 2024

IMO we should also support running benchmark all-pallets or whatever it is called. Not sure why we don't have this :P

Yea... all-pallets sounds good as well. Normally these small things have no prio, so they never happen 😆

I would like to work on this

Thanks, please go ahead. Once you have some code, you can open a merge request and you can ask questions there.

@ggwpez ggwpez added the T12-benchmarks This PR/Issue is related to benchmarking and weights. label Feb 5, 2024
@ggwpez ggwpez added the C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK. label Feb 15, 2024
@dastansam
Copy link
Contributor

dastansam commented Feb 19, 2024

hey @ggwpez,

sorry, I just got time to work on this. I opened a PR #3395

@dastansam
Copy link
Contributor

hey @ggwpez,

sorry, I just got time work on this. I opened a PR #3395

I have some doubts regarding namings and whether all-pallets should be part of PalletCmd or a separate subcommand in BenchmarkCmd, i.e AllPalletsCmd?

github-merge-queue bot pushed a commit that referenced this issue Feb 21, 2024
closes #2844 

- adds `list-pallets` option which prints all unique available pallets
for benchmarking
```bash
./target/release/node benchmark pallet --list=pallets
```
- adds `all` option which runs benchmarks for all available pallets and
extrinsics (equivalent to `--pallet * --extrinsic *`)
```bash
./target/release/node benchmark pallet --all
```

- use the `list=pallets` syntax in `run_all_benchmarks.sh` script

cc ggwpez

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
@github-project-automation github-project-automation bot moved this from Backlog to Done in Benchmarking and Weights Feb 21, 2024
bgallois pushed a commit to duniter/duniter-polkadot-sdk that referenced this issue Mar 25, 2024
closes paritytech#2844 

- adds `list-pallets` option which prints all unique available pallets
for benchmarking
```bash
./target/release/node benchmark pallet --list=pallets
```
- adds `all` option which runs benchmarks for all available pallets and
extrinsics (equivalent to `--pallet * --extrinsic *`)
```bash
./target/release/node benchmark pallet --all
```

- use the `list=pallets` syntax in `run_all_benchmarks.sh` script

cc ggwpez

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK. D0-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder. T12-benchmarks This PR/Issue is related to benchmarking and weights.
Projects
Development

Successfully merging a pull request may close this issue.

3 participants