Force base weights to be the minimum only when the intercept is negative (#12482)

* Force base weights to be the minimum only when the intercept is negative; emit minimum execution times

* Add an `assert` making sure the intercept is zero when it's supposed to be zero

* Fix template

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* ".git/.scripts/bench-bot.sh" pallet dev pallet_assets

* ".git/.scripts/bench-bot.sh" pallet dev pallet_uniques

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: command-bot <>
This commit is contained in:
Koute
2022-10-21 05:07:52 +09:00
committed by GitHub
parent 62d72f9258
commit 92d2977292
6 changed files with 314 additions and 166 deletions
@@ -33,6 +33,7 @@ impl<T: frame_system::Config> {{pallet}}::WeightInfo for WeightInfo<T> {
{{~#each benchmark.components as |c| ~}}
{{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}}
) -> Weight {
// Minimum execution time: {{underscore benchmark.min_execution_time}} nanoseconds.
Weight::from_ref_time({{underscore benchmark.base_weight}} as u64)
{{#each benchmark.component_weight as |cw|}}
// Standard Error: {{underscore cw.error}}
@@ -69,6 +69,8 @@ struct BenchmarkData {
component_writes: Vec<ComponentSlope>,
component_ranges: Vec<ComponentRange>,
comments: Vec<String>,
#[serde(serialize_with = "string_serialize")]
min_execution_time: u128,
}
// This forwards some specific metadata from the `PalletCmd`
@@ -257,6 +259,7 @@ fn get_benchmark_data(
component_writes: used_writes,
component_ranges,
comments,
min_execution_time: extrinsic_time.minimum,
}
}