Skip to content

Commit ed00ea3

Browse files
Bennethxyzloneggwpez
authored
docs(omni-bencher): document weight template rendering (#7038) (#10256)
Documents how to render weight files with frame-omni-bencher using:\n\n- --output (directory or file)\n- --header for a custom header\n- --template for a custom Handlebars template\n\nThis leverages existing frame_benchmarking_cli functionality exposed via omni-bencher.\n\n Co-authored-by: lone <lone@lones-MacBook-Air.local> Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
1 parent 38c598e commit ed00ea3

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

substrate/utils/frame/omni-bencher/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,23 @@ frame-omni-bencher v1 benchmark pallet \
5454
The `--steps`, `--repeat`, `--heap-pages` and `--wasm-execution` arguments have sane defaults and do
5555
not need be passed explicitly anymore.
5656

57+
### Generate weights (templates)
58+
59+
To render Rust weight files from benchmark results, pass an output path. Optionally you can pass a
60+
custom header and a Handlebars template (defaults are provided):
61+
62+
```sh
63+
frame-omni-bencher v1 benchmark pallet \
64+
--runtime target/release/wbuild/westend-runtime/westend-runtime.compact.compressed.wasm \
65+
--pallet "pallet_balances" --extrinsic "*" \
66+
--output ./weights/ \
67+
--header ./HEADER.rs \
68+
--template ./template.hbs
69+
```
70+
71+
This uses the same flags as the node-integrated benchmarking CLI. The output can be a directory or a
72+
file path; when a directory is given, a file name is generated per pallet/instance.
73+
5774
## Backwards Compatibility
5875

5976
The exposed pallet sub-command is identical as the node-integrated CLI. The only difference is that

0 commit comments

Comments
 (0)