Optimized weights (#10692)

* Add optimization flags to 'release' profile

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

* Optimized weights

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

* Add missing pallets

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

* Add `production` profile

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

* pallet-collective: fix tests

the weight of System.remark went to 0, the collective test uses a
remark call to trigger an out-of-gas condition so I replaced it
with a `remark_with_event` call.

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
Oliver Tale-Yazdi
2022-01-24 13:35:25 +01:00
committed by GitHub
parent 8c6301a6e6
commit 9daea28085
33 changed files with 2228 additions and 2174 deletions
+73 -72
View File
@@ -1,6 +1,6 @@
// This file is part of Substrate.
// Copyright (C) 2021-2022 Parity Technologies (UK) Ltd.
// Copyright (C) 2022 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,11 +18,11 @@
//! Autogenerated weights for pallet_assets
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2021-08-07, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128
//! DATE: 2022-01-17, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024
// Executed Command:
// target/release/substrate
// ./target/lto-fat-cg1/substrate
// benchmark
// --chain=dev
// --steps=50
@@ -33,8 +33,9 @@
// --wasm-execution=compiled
// --heap-pages=4096
// --output=./frame/assets/src/weights.rs
// --template=./.maintain/frame-weight-template.hbs
// --template=.maintain/frame-weight-template.hbs
// --header=LICENSE-APACHE2
// --raw
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
@@ -75,13 +76,13 @@ pub struct SubstrateWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: Assets Asset (r:1 w:1)
fn create() -> Weight {
(41_651_000 as Weight)
(22_050_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Assets Asset (r:1 w:1)
fn force_create() -> Weight {
(21_378_000 as Weight)
(11_673_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
@@ -92,12 +93,12 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: Assets Approvals (r:501 w:500)
fn destroy(c: u32, s: u32, a: u32, ) -> Weight {
(0 as Weight)
// Standard Error: 32_000
.saturating_add((21_163_000 as Weight).saturating_mul(c as Weight))
// Standard Error: 32_000
.saturating_add((26_932_000 as Weight).saturating_mul(s as Weight))
// Standard Error: 329_000
.saturating_add((29_714_000 as Weight).saturating_mul(a as Weight))
// Standard Error: 36_000
.saturating_add((14_657_000 as Weight).saturating_mul(c as Weight))
// Standard Error: 36_000
.saturating_add((17_018_000 as Weight).saturating_mul(s as Weight))
// Standard Error: 362_000
.saturating_add((16_620_000 as Weight).saturating_mul(a as Weight))
.saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(c as Weight)))
.saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(s as Weight)))
@@ -110,14 +111,14 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: Assets Asset (r:1 w:1)
// Storage: Assets Account (r:1 w:1)
fn mint() -> Weight {
(47_913_000 as Weight)
(26_254_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: Assets Asset (r:1 w:1)
// Storage: Assets Account (r:1 w:1)
fn burn() -> Weight {
(55_759_000 as Weight)
(30_407_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
@@ -125,7 +126,7 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: Assets Account (r:2 w:2)
// Storage: System Account (r:1 w:1)
fn transfer() -> Weight {
(83_205_000 as Weight)
(44_220_000 as Weight)
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
@@ -133,7 +134,7 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: Assets Account (r:2 w:2)
// Storage: System Account (r:1 w:1)
fn transfer_keep_alive() -> Weight {
(70_665_000 as Weight)
(36_910_000 as Weight)
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
@@ -141,93 +142,93 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: Assets Account (r:2 w:2)
// Storage: System Account (r:1 w:1)
fn force_transfer() -> Weight {
(81_458_000 as Weight)
(44_330_000 as Weight)
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
// Storage: Assets Asset (r:1 w:0)
// Storage: Assets Account (r:1 w:1)
fn freeze() -> Weight {
(32_845_000 as Weight)
(17_937_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Assets Asset (r:1 w:0)
// Storage: Assets Account (r:1 w:1)
fn thaw() -> Weight {
(33_303_000 as Weight)
(18_224_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Assets Asset (r:1 w:1)
fn freeze_asset() -> Weight {
(23_434_000 as Weight)
(14_875_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Assets Asset (r:1 w:1)
fn thaw_asset() -> Weight {
(24_173_000 as Weight)
(14_792_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Assets Asset (r:1 w:1)
// Storage: Assets Metadata (r:1 w:0)
fn transfer_ownership() -> Weight {
(27_466_000 as Weight)
(15_794_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Assets Asset (r:1 w:1)
fn set_team() -> Weight {
(24_608_000 as Weight)
(14_702_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Assets Asset (r:1 w:0)
// Storage: Assets Metadata (r:1 w:1)
fn set_metadata(n: u32, s: u32, ) -> Weight {
(49_515_000 as Weight)
// Standard Error: 1_000
.saturating_add((1_000 as Weight).saturating_mul(n as Weight))
// Standard Error: 1_000
.saturating_add((6_000 as Weight).saturating_mul(s as Weight))
(27_368_000 as Weight)
// Standard Error: 0
.saturating_add((4_000 as Weight).saturating_mul(n as Weight))
// Standard Error: 0
.saturating_add((4_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Assets Asset (r:1 w:0)
// Storage: Assets Metadata (r:1 w:1)
fn clear_metadata() -> Weight {
(48_163_000 as Weight)
(28_222_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Assets Asset (r:1 w:0)
// Storage: Assets Metadata (r:1 w:1)
fn force_set_metadata(_n: u32, s: u32, ) -> Weight {
(26_722_000 as Weight)
(15_139_000 as Weight)
// Standard Error: 0
.saturating_add((5_000 as Weight).saturating_mul(s as Weight))
.saturating_add((3_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Assets Asset (r:1 w:0)
// Storage: Assets Metadata (r:1 w:1)
fn force_clear_metadata() -> Weight {
(47_923_000 as Weight)
(28_065_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Assets Asset (r:1 w:1)
fn force_asset_status() -> Weight {
(23_081_000 as Weight)
(13_808_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Assets Asset (r:1 w:1)
// Storage: Assets Approvals (r:1 w:1)
fn approve_transfer() -> Weight {
(56_998_000 as Weight)
(31_261_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
@@ -236,21 +237,21 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: Assets Account (r:2 w:2)
// Storage: System Account (r:1 w:1)
fn transfer_approved() -> Weight {
(107_171_000 as Weight)
(56_329_000 as Weight)
.saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().writes(5 as Weight))
}
// Storage: Assets Asset (r:1 w:1)
// Storage: Assets Approvals (r:1 w:1)
fn cancel_approval() -> Weight {
(57_358_000 as Weight)
(32_086_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: Assets Asset (r:1 w:1)
// Storage: Assets Approvals (r:1 w:1)
fn force_cancel_approval() -> Weight {
(58_330_000 as Weight)
(32_502_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
@@ -260,13 +261,13 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
impl WeightInfo for () {
// Storage: Assets Asset (r:1 w:1)
fn create() -> Weight {
(41_651_000 as Weight)
(22_050_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
// Storage: Assets Asset (r:1 w:1)
fn force_create() -> Weight {
(21_378_000 as Weight)
(11_673_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
@@ -277,12 +278,12 @@ impl WeightInfo for () {
// Storage: Assets Approvals (r:501 w:500)
fn destroy(c: u32, s: u32, a: u32, ) -> Weight {
(0 as Weight)
// Standard Error: 32_000
.saturating_add((21_163_000 as Weight).saturating_mul(c as Weight))
// Standard Error: 32_000
.saturating_add((26_932_000 as Weight).saturating_mul(s as Weight))
// Standard Error: 329_000
.saturating_add((29_714_000 as Weight).saturating_mul(a as Weight))
// Standard Error: 36_000
.saturating_add((14_657_000 as Weight).saturating_mul(c as Weight))
// Standard Error: 36_000
.saturating_add((17_018_000 as Weight).saturating_mul(s as Weight))
// Standard Error: 362_000
.saturating_add((16_620_000 as Weight).saturating_mul(a as Weight))
.saturating_add(RocksDbWeight::get().reads(5 as Weight))
.saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(c as Weight)))
.saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(s as Weight)))
@@ -295,14 +296,14 @@ impl WeightInfo for () {
// Storage: Assets Asset (r:1 w:1)
// Storage: Assets Account (r:1 w:1)
fn mint() -> Weight {
(47_913_000 as Weight)
(26_254_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
}
// Storage: Assets Asset (r:1 w:1)
// Storage: Assets Account (r:1 w:1)
fn burn() -> Weight {
(55_759_000 as Weight)
(30_407_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
}
@@ -310,7 +311,7 @@ impl WeightInfo for () {
// Storage: Assets Account (r:2 w:2)
// Storage: System Account (r:1 w:1)
fn transfer() -> Weight {
(83_205_000 as Weight)
(44_220_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(4 as Weight))
.saturating_add(RocksDbWeight::get().writes(4 as Weight))
}
@@ -318,7 +319,7 @@ impl WeightInfo for () {
// Storage: Assets Account (r:2 w:2)
// Storage: System Account (r:1 w:1)
fn transfer_keep_alive() -> Weight {
(70_665_000 as Weight)
(36_910_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(4 as Weight))
.saturating_add(RocksDbWeight::get().writes(4 as Weight))
}
@@ -326,93 +327,93 @@ impl WeightInfo for () {
// Storage: Assets Account (r:2 w:2)
// Storage: System Account (r:1 w:1)
fn force_transfer() -> Weight {
(81_458_000 as Weight)
(44_330_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(4 as Weight))
.saturating_add(RocksDbWeight::get().writes(4 as Weight))
}
// Storage: Assets Asset (r:1 w:0)
// Storage: Assets Account (r:1 w:1)
fn freeze() -> Weight {
(32_845_000 as Weight)
(17_937_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
// Storage: Assets Asset (r:1 w:0)
// Storage: Assets Account (r:1 w:1)
fn thaw() -> Weight {
(33_303_000 as Weight)
(18_224_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
// Storage: Assets Asset (r:1 w:1)
fn freeze_asset() -> Weight {
(23_434_000 as Weight)
(14_875_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
// Storage: Assets Asset (r:1 w:1)
fn thaw_asset() -> Weight {
(24_173_000 as Weight)
(14_792_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
// Storage: Assets Asset (r:1 w:1)
// Storage: Assets Metadata (r:1 w:0)
fn transfer_ownership() -> Weight {
(27_466_000 as Weight)
(15_794_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
// Storage: Assets Asset (r:1 w:1)
fn set_team() -> Weight {
(24_608_000 as Weight)
(14_702_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
// Storage: Assets Asset (r:1 w:0)
// Storage: Assets Metadata (r:1 w:1)
fn set_metadata(n: u32, s: u32, ) -> Weight {
(49_515_000 as Weight)
// Standard Error: 1_000
.saturating_add((1_000 as Weight).saturating_mul(n as Weight))
// Standard Error: 1_000
.saturating_add((6_000 as Weight).saturating_mul(s as Weight))
(27_368_000 as Weight)
// Standard Error: 0
.saturating_add((4_000 as Weight).saturating_mul(n as Weight))
// Standard Error: 0
.saturating_add((4_000 as Weight).saturating_mul(s as Weight))
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
// Storage: Assets Asset (r:1 w:0)
// Storage: Assets Metadata (r:1 w:1)
fn clear_metadata() -> Weight {
(48_163_000 as Weight)
(28_222_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
// Storage: Assets Asset (r:1 w:0)
// Storage: Assets Metadata (r:1 w:1)
fn force_set_metadata(_n: u32, s: u32, ) -> Weight {
(26_722_000 as Weight)
(15_139_000 as Weight)
// Standard Error: 0
.saturating_add((5_000 as Weight).saturating_mul(s as Weight))
.saturating_add((3_000 as Weight).saturating_mul(s as Weight))
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
// Storage: Assets Asset (r:1 w:0)
// Storage: Assets Metadata (r:1 w:1)
fn force_clear_metadata() -> Weight {
(47_923_000 as Weight)
(28_065_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
// Storage: Assets Asset (r:1 w:1)
fn force_asset_status() -> Weight {
(23_081_000 as Weight)
(13_808_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
// Storage: Assets Asset (r:1 w:1)
// Storage: Assets Approvals (r:1 w:1)
fn approve_transfer() -> Weight {
(56_998_000 as Weight)
(31_261_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
}
@@ -421,21 +422,21 @@ impl WeightInfo for () {
// Storage: Assets Account (r:2 w:2)
// Storage: System Account (r:1 w:1)
fn transfer_approved() -> Weight {
(107_171_000 as Weight)
(56_329_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(5 as Weight))
.saturating_add(RocksDbWeight::get().writes(5 as Weight))
}
// Storage: Assets Asset (r:1 w:1)
// Storage: Assets Approvals (r:1 w:1)
fn cancel_approval() -> Weight {
(57_358_000 as Weight)
(32_086_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
}
// Storage: Assets Asset (r:1 w:1)
// Storage: Assets Approvals (r:1 w:1)
fn force_cancel_approval() -> Weight {
(58_330_000 as Weight)
(32_502_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
}