diff --git a/frame/contracts/src/benchmarking/mod.rs b/frame/contracts/src/benchmarking/mod.rs index 55b83749d1c7f..2a9f93428c9ff 100644 --- a/frame/contracts/src/benchmarking/mod.rs +++ b/frame/contracts/src/benchmarking/mod.rs @@ -1506,7 +1506,7 @@ benchmarks! { sbox.invoke(); } - // w_br = w_bench - 2 * w_param + // w_br = w_bench - 5 * w_param instr_br { let r in 0 .. INSTR_BENCHMARK_BATCHES; let mut sbox = Sandbox::from(&WasmModule::::from(ModuleDefinition { @@ -1531,9 +1531,9 @@ benchmarks! { sbox.invoke(); } - // w_br_if = w_bench - 5 * w_param - // The two additional pushes + drop are only executed 50% of the time. - // Making it: 3 * w_param + (50% * 4 * w_param) + // w_br_if = w_bench - 8 * w_param + // The additional pushe + drop is only executed 50% of the time. + // Making it: 6 * w_param + (50% * 4 * w_param) instr_br_if { let r in 0 .. INSTR_BENCHMARK_BATCHES; let mut sbox = Sandbox::from(&WasmModule::::from(ModuleDefinition { @@ -1559,8 +1559,8 @@ benchmarks! { sbox.invoke(); } - // w_br_table = w_bench - 3 * w_param - // 1 * w_param + 0.5 * 2 * w_param + 0.25 * 4 * w_param + // w_br_table = w_bench - 6 * w_param + // 4 * w_param + 0.5 * 2 * w_param + 0.25 * 4 * w_param + 0.25 * 0 * w_param instr_br_table { let r in 0 .. INSTR_BENCHMARK_BATCHES; let table = Box::new(BrTableData { diff --git a/frame/contracts/src/schedule.rs b/frame/contracts/src/schedule.rs index 14e4a125eca1d..5b5bd36ee5df5 100644 --- a/frame/contracts/src/schedule.rs +++ b/frame/contracts/src/schedule.rs @@ -494,9 +494,9 @@ impl Default for InstructionWeights { i64store: cost_instr!(instr_i64store, 2), 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_table: cost_instr!(instr_br_table, 3), + br: cost_instr!(instr_br, 5), + br_if: cost_instr!(instr_br_if, 8), + br_table: cost_instr!(instr_br_table, 6), br_table_per_entry: cost_instr!(instr_br_table_per_entry, 0), call: cost_instr!(instr_call, 2), call_indirect: cost_instr!(instr_call_indirect, 3),