Improve instruction benchmarks (#9712)

* seal_input can be called multiple times

* Increase size of instruction benchmarks

* Remove randomness from instr_br* benchmarks

* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_contracts --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/contracts/src/weights.rs --template=./.maintain/frame-weight-template.hbs

Co-authored-by: Parity Bot <admin@parity.io>
This commit is contained in:
Alexander Theißen
2021-09-09 11:12:08 +02:00
committed by GitHub
parent 5666d9de94
commit a443944167
5 changed files with 608 additions and 606 deletions
+4 -4
View File
@@ -36,7 +36,7 @@ pub const API_BENCHMARK_BATCH_SIZE: u32 = 100;
/// How many instructions are executed in a single batch. The reasoning is the same
/// as for `API_BENCHMARK_BATCH_SIZE`.
pub const INSTR_BENCHMARK_BATCH_SIZE: u32 = 1_000;
pub const INSTR_BENCHMARK_BATCH_SIZE: u32 = 100;
/// Definition of the cost schedule and other parameterizations for the wasm vm.
///
@@ -495,7 +495,7 @@ impl<T: Config> Default for InstructionWeights<T> {
select: cost_instr!(instr_select, 4),
r#if: cost_instr!(instr_if, 3),
br: cost_instr!(instr_br, 2),
br_if: cost_instr!(instr_br_if, 5),
br_if: cost_instr!(instr_br_if, 3),
br_table: cost_instr!(instr_br_table, 3),
br_table_per_entry: cost_instr!(instr_br_table_per_entry, 0),
call: cost_instr!(instr_call, 2),
@@ -559,8 +559,8 @@ impl<T: Config> Default for HostFnWeights<T> {
now: cost_batched!(seal_now),
weight_to_fee: cost_batched!(seal_weight_to_fee),
gas: cost_batched!(seal_gas),
input: cost!(seal_input),
input_per_byte: cost_byte!(seal_input_per_kb),
input: cost_batched!(seal_input),
input_per_byte: cost_byte_batched!(seal_input_per_kb),
r#return: cost!(seal_return),
return_per_byte: cost_byte!(seal_return_per_kb),
terminate: cost!(seal_terminate),