-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add benchmarking for parachain runtime initializer pallet #3913
Conversation
/benchmark runtime westend runtime_parachains::initializer |
Benchmark Runtime Westend Pallet for branch "kckyeung/parachains-initializer-benchmarking" with command cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=runtime_parachains::initializer --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/runtime_parachains_initializer.rs Results
ERROR: Unable to commit file ./runtime/westend/src/weights/runtime_parachains_initializer.rs |
/benchmark runtime westend runtime_parachains::initializer |
Benchmark Runtime Westend Pallet for branch "kckyeung/parachains-initializer-benchmarking" with command cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=runtime_parachains::initializer --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/runtime_parachains_initializer.rs Results
|
…kckyeung/parachains-initializer-benchmarking
…k --chain=westend-dev --steps=50 --repeat=20 --pallet=runtime_parachains::initializer --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/runtime_parachains_initializer.rs
/benchmark runtime kusama runtime_parachains::initializer |
Benchmark Runtime Kusama Pallet for branch "kckyeung/parachains-initializer-benchmarking" with command cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=runtime_parachains::initializer --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/runtime_parachains_initializer.rs Results
|
…k --chain=kusama-dev --steps=50 --repeat=20 --pallet=runtime_parachains::initializer --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/runtime_parachains_initializer.rs
@@ -805,7 +805,7 @@ impl pallet_proxy::Config for Runtime { | |||
impl parachains_origin::Config for Runtime {} | |||
|
|||
impl parachains_configuration::Config for Runtime { | |||
type WeightInfo = parachains_configuration::weights::WeightInfo<Runtime>; | |||
type WeightInfo = weights::runtime_parachains_configuration::WeightInfo<Runtime>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think #3914 should take of this
); | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Essentially I think the only storage op here is an <Digest<T>>::append(item);
- without looking at the code I am guessing it has to decode the vec, push the item, and then encode it (But maybe it is more optimized?). I am wondering if for something like this we should benchmark with a large vec to assume worst case?
My naive guess though is that practically we will never have enough logs for the append op to be that expensive + this is from a force origin so it doesn't look like a significant DoS vector.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked through the code, and while it doesn't decode the entire vec (it only decodes the first 4 bytes to get the encoded length), it does however copy the entire vec to a new one whenever the new encoded length is different from the previous (which is pretty much always).
I'll most likely need to add in a variable and see how the complexity varies with the digest vec length.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generally looks good to me. Maybe worth looking into if filling up the vec of digest logs would get a better worst case benchmark.
/benchmark runtime westend runtime_parachains::initializer |
Benchmark Runtime Westend Pallet for branch "kckyeung/parachains-initializer-benchmarking" with command cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=runtime_parachains::initializer --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/runtime_parachains_initializer.rs Results
|
…k --chain=westend-dev --steps=50 --repeat=20 --pallet=runtime_parachains::initializer --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/runtime_parachains_initializer.rs
/benchmark runtime kusama runtime_parachains::initializer |
Benchmark Runtime Kusama Pallet for branch "kckyeung/parachains-initializer-benchmarking" with command cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=runtime_parachains::initializer --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/runtime_parachains_initializer.rs Results
|
…k --chain=kusama-dev --steps=50 --repeat=20 --pallet=runtime_parachains::initializer --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/runtime_parachains_initializer.rs
bot merge |
Merge aborted: Checks failed for 48d549e |
bot merge |
Trying merge. |
* master: feat: measured oneshots (#3902) remove `AllSubsystems` and `AllSubsystemsGen` types (#3874) Companion for Substrate#9867 (#3938) Substrate Companion for #9552 (#3834) CI: run disputes tests (#3962) Bump parity-scale-codec from 2.3.0 to 2.3.1 (#3959) approval-voting: populate session cache in advance (#3954) Bump libc from 0.2.102 to 0.2.103 (#3950) fix master (#3955) Docker files chore (#3880) Bump nix from 0.19.1 to 0.20.0 (#3587) remove connected disconnected state, 3rd attempt (#3898) fix flaky chain-selection tests (#3948) Add benchmarking for parachain runtime initializer pallet (#3913) minor chore changes (#3944) disputes: reject single-sided disputes (#3903)
Part of #3850.