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

Automatically benchmark runtimes #1009

Closed
gregdhill opened this issue Apr 13, 2023 · 3 comments · Fixed by #1070
Closed

Automatically benchmark runtimes #1009

gregdhill opened this issue Apr 13, 2023 · 3 comments · Fixed by #1070
Assignees

Comments

@gregdhill
Copy link
Member

We need some tooling to automatically run our benchmarks and output the weights (see the kusama runtime structure for example). I'm not sure what the best approach is but I like Acala's setup so we can run the /bench command from the PR for an individual pallet or the entire runtime - although I'm not sure how these files are then committed. I took a brief look at Parity's setup and they seem to run the benchmarks elsewhere (I think GitLab) and commit the updated weights manually. Whatever solution we adopt I would like to have these run more frequently so we can catch breaking changes early - automatically running in PRs would be great but not sure if this would take too long.

@gregdhill
Copy link
Member Author

gregdhill commented Apr 13, 2023

Example command to run the benchmarks for the kintsugi runtime and output those to a weights directory:

cargo run --bin interbtc-parachain --features runtime-benchmarks --release -- benchmark pallet --pallet '*' --extrinsic '*' --chain kintsugi-dev --execution=wasm --wasm-execution=compiled --steps 50 --repeat 20 --output parachain/runtime/kintsugi/src/weights/ --template .deploy/weight-template.hbs

@sander2
Copy link
Member

sander2 commented Apr 14, 2023

cargo run --bin interbtc-parachain --features runtime-benchmarks --release -- benchmark pallet --pallet '*' --extrinsic '*' --chain kintsugi-dev --execution=wasm --wasm-execution=compiled --steps 50 --repeat 

You need to use the new runtime-specific template, so e.g.

cargo run --bin interbtc-parachain --features runtime-benchmarks --release -- benchmark pallet --pallet '*' --extrinsic '*' --chain kintsugi-dev --execution=wasm --wasm-execution=compiled --steps 100 --repeat 10 --output parachain/runtime/kintsugi/src/weights/ --template .deploy/runtime-weight-template.hbs

@sander2
Copy link
Member

sander2 commented Apr 14, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants