diff --git a/Makefile b/Makefile index 0583cd27d..51dfe8fe8 100644 --- a/Makefile +++ b/Makefile @@ -47,3 +47,17 @@ dev-check-tests: Cargo.toml dev-test: Cargo.toml cargo test --all --features runtime-benchmarks + +# run benchmarks via Acala node +benchmark-all: + cargo run --release --bin=acala --features=runtime-benchmarks -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=orml_auction --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./auction/src/weights.rs --template ../templates/orml-weight-template.hbs + + cargo run --release --bin=acala --features=runtime-benchmarks -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=orml_authority --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./authority/src/weights.rs --template ../templates/orml-weight-template.hbs + + cargo run --release --bin=acala --features=runtime-benchmarks -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=module_currencies --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./currencies/src/weights.rs --template ../templates/orml-weight-template.hbs + + cargo run --release --bin=acala --features=runtime-benchmarks -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=orml_oracle --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./oracle/src/weights.rs --template ../templates/orml-weight-template.hbs + + cargo run --release --bin=acala --features=runtime-benchmarks -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=orml_tokens --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./tokens/src/weights.rs --template ../templates/orml-weight-template.hbs + + cargo run --release --bin=acala --features=runtime-benchmarks -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=orml_vesting --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./vesting/src/weights.rs --template ../templates/orml-weight-template.hbs diff --git a/auction/src/default_weight.rs b/auction/src/default_weight.rs deleted file mode 100644 index 26e552fef..000000000 --- a/auction/src/default_weight.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0 - -#![allow(unused_parens)] -#![allow(unused_imports)] -#![allow(clippy::unnecessary_cast)] - -use frame_support::weights::{constants::RocksDbWeight as DbWeight, Weight}; - -impl crate::WeightInfo for () { - fn bid_collateral_auction() -> Weight { - (493_957_000 as Weight) - .saturating_add(DbWeight::get().reads(12 as Weight)) - .saturating_add(DbWeight::get().writes(12 as Weight)) - } - fn on_finalize(c: u32) -> Weight { - (50_992_000 as Weight) - .saturating_add((171_653_000 as Weight).saturating_mul(c as Weight)) - .saturating_add(DbWeight::get().reads(3 as Weight)) - .saturating_add(DbWeight::get().reads((4 as Weight).saturating_mul(c as Weight))) - .saturating_add(DbWeight::get().writes(2 as Weight)) - .saturating_add(DbWeight::get().writes((3 as Weight).saturating_mul(c as Weight))) - } -} diff --git a/auction/src/lib.rs b/auction/src/lib.rs index 184fc4259..69aefa886 100644 --- a/auction/src/lib.rs +++ b/auction/src/lib.rs @@ -21,21 +21,17 @@ use sp_runtime::{ DispatchError, DispatchResult, }; -mod default_weight; mod mock; mod tests; +mod weights; pub use module::*; +pub use weights::WeightInfo; #[frame_support::pallet] pub mod module { use super::*; - pub trait WeightInfo { - fn bid_collateral_auction() -> Weight; - fn on_finalize(c: u32) -> Weight; - } - #[pallet::config] pub trait Config: frame_system::Config { type Event: From> + IsType<::Event>; diff --git a/auction/src/weights.rs b/auction/src/weights.rs new file mode 100644 index 000000000..9dcb4f32d --- /dev/null +++ b/auction/src/weights.rs @@ -0,0 +1,53 @@ +//! Autogenerated weights for orml_auction +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 +//! DATE: 2021-05-04, STEPS: [50, ], REPEAT: 20, LOW RANGE: [], HIGH RANGE: [] +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128 + +// Executed Command: +// /Users/xiliangchen/projects/acala/target/release/acala +// benchmark +// --chain=dev +// --steps=50 +// --repeat=20 +// --pallet=orml_auction +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./auction/src/weights.rs +// --template +// ../templates/orml-weight-template.hbs + + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(clippy::unnecessary_cast)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions needed for orml_auction. +pub trait WeightInfo { + fn bid_collateral_auction() -> Weight; + fn on_finalize(c: u32, ) -> Weight; +} + +/// Default weights. +impl WeightInfo for () { + fn bid_collateral_auction() -> Weight { + (108_000_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(8 as Weight)) + .saturating_add(RocksDbWeight::get().writes(9 as Weight)) + } + fn on_finalize(c: u32, ) -> Weight { + (9_779_000 as Weight) + // Standard Error: 13_000 + .saturating_add((57_962_000 as Weight).saturating_mul(c as Weight)) + .saturating_add(RocksDbWeight::get().reads(10 as Weight)) + .saturating_add(RocksDbWeight::get().reads((3 as Weight).saturating_mul(c as Weight))) + .saturating_add(RocksDbWeight::get().writes(7 as Weight)) + .saturating_add(RocksDbWeight::get().writes((3 as Weight).saturating_mul(c as Weight))) + } +} diff --git a/authority/src/default_weight.rs b/authority/src/default_weight.rs deleted file mode 100644 index 802a567bb..000000000 --- a/authority/src/default_weight.rs +++ /dev/null @@ -1,44 +0,0 @@ -//! Weights for orml_authority -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0 -//! DATE: 2020-11-18, STEPS: [1, ], REPEAT: 1, LOW RANGE: [], HIGH RANGE: [] -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB -//! CACHE: 128 - -#![allow(unused_parens)] -#![allow(unused_imports)] -#![allow(clippy::unnecessary_cast)] - -use frame_support::weights::{constants::RocksDbWeight as DbWeight, Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for orml_authority. -impl crate::WeightInfo for () { - fn dispatch_as() -> Weight { - (48_680_000 as Weight) - } - fn schedule_dispatch_without_delay() -> Weight { - (121_510_000 as Weight) - .saturating_add(DbWeight::get().reads(3 as Weight)) - .saturating_add(DbWeight::get().writes(3 as Weight)) - } - fn schedule_dispatch_with_delay() -> Weight { - (130_696_000 as Weight) - .saturating_add(DbWeight::get().reads(3 as Weight)) - .saturating_add(DbWeight::get().writes(3 as Weight)) - } - fn fast_track_scheduled_dispatch() -> Weight { - (145_530_000 as Weight) - .saturating_add(DbWeight::get().reads(3 as Weight)) - .saturating_add(DbWeight::get().writes(3 as Weight)) - } - fn delay_scheduled_dispatch() -> Weight { - (145_169_000 as Weight) - .saturating_add(DbWeight::get().reads(3 as Weight)) - .saturating_add(DbWeight::get().writes(3 as Weight)) - } - fn cancel_scheduled_dispatch() -> Weight { - (104_990_000 as Weight) - .saturating_add(DbWeight::get().reads(2 as Weight)) - .saturating_add(DbWeight::get().writes(2 as Weight)) - } -} diff --git a/authority/src/lib.rs b/authority/src/lib.rs index 9ee84333b..ef4aec224 100644 --- a/authority/src/lib.rs +++ b/authority/src/lib.rs @@ -35,9 +35,11 @@ use sp_runtime::{ }; use sp_std::prelude::*; -mod default_weight; mod mock; mod tests; +mod weights; + +pub use weights::WeightInfo; /// A delayed origin. Can only be dispatched via `dispatch_as` with a delay. #[derive(PartialEq, Eq, Clone, RuntimeDebug, Encode, Decode)] @@ -120,15 +122,6 @@ pub use module::*; pub mod module { use super::*; - pub trait WeightInfo { - fn dispatch_as() -> Weight; - fn schedule_dispatch_without_delay() -> Weight; - fn schedule_dispatch_with_delay() -> Weight; - fn fast_track_scheduled_dispatch() -> Weight; - fn delay_scheduled_dispatch() -> Weight; - fn cancel_scheduled_dispatch() -> Weight; - } - /// Origin for the authority module. pub type Origin = DelayedOrigin<::BlockNumber, ::PalletsOrigin>; pub(crate) type CallOf = ::Call; diff --git a/authority/src/weights.rs b/authority/src/weights.rs new file mode 100644 index 000000000..59c1354f1 --- /dev/null +++ b/authority/src/weights.rs @@ -0,0 +1,71 @@ +//! Autogenerated weights for orml_authority +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 +//! DATE: 2021-05-04, STEPS: [50, ], REPEAT: 20, LOW RANGE: [], HIGH RANGE: [] +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128 + +// Executed Command: +// /Users/xiliangchen/projects/acala/target/release/acala +// benchmark +// --chain=dev +// --steps=50 +// --repeat=20 +// --pallet=orml_authority +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./authority/src/weights.rs +// --template +// ../templates/orml-weight-template.hbs + + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(clippy::unnecessary_cast)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions needed for orml_authority. +pub trait WeightInfo { + fn dispatch_as() -> Weight; + fn schedule_dispatch_without_delay() -> Weight; + fn schedule_dispatch_with_delay() -> Weight; + fn fast_track_scheduled_dispatch() -> Weight; + fn delay_scheduled_dispatch() -> Weight; + fn cancel_scheduled_dispatch() -> Weight; +} + +/// Default weights. +impl WeightInfo for () { + fn dispatch_as() -> Weight { + (10_000_000 as Weight) + } + fn schedule_dispatch_without_delay() -> Weight { + (28_000_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(3 as Weight)) + .saturating_add(RocksDbWeight::get().writes(3 as Weight)) + } + fn schedule_dispatch_with_delay() -> Weight { + (29_000_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(3 as Weight)) + .saturating_add(RocksDbWeight::get().writes(3 as Weight)) + } + fn fast_track_scheduled_dispatch() -> Weight { + (36_000_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(3 as Weight)) + .saturating_add(RocksDbWeight::get().writes(3 as Weight)) + } + fn delay_scheduled_dispatch() -> Weight { + (36_000_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(3 as Weight)) + .saturating_add(RocksDbWeight::get().writes(3 as Weight)) + } + fn cancel_scheduled_dispatch() -> Weight { + (24_000_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + } +} diff --git a/currencies/src/lib.rs b/currencies/src/lib.rs index db2fd9d44..cec25c405 100644 --- a/currencies/src/lib.rs +++ b/currencies/src/lib.rs @@ -65,24 +65,17 @@ use sp_std::{ marker, result, }; -mod default_weight; mod mock; mod tests; +mod weights; pub use module::*; +pub use weights::WeightInfo; #[frame_support::pallet] pub mod module { use super::*; - pub trait WeightInfo { - fn transfer_non_native_currency() -> Weight; - fn transfer_native_currency() -> Weight; - fn update_balance_non_native_currency() -> Weight; - fn update_balance_native_currency_creating() -> Weight; - fn update_balance_native_currency_killing() -> Weight; - } - pub(crate) type BalanceOf = <::MultiCurrency as MultiCurrency<::AccountId>>::Balance; pub(crate) type CurrencyIdOf = diff --git a/currencies/src/weights.rs b/currencies/src/weights.rs new file mode 100644 index 000000000..a75ebb239 --- /dev/null +++ b/currencies/src/weights.rs @@ -0,0 +1,67 @@ +//! Autogenerated weights for module_currencies +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 +//! DATE: 2021-05-04, STEPS: [50, ], REPEAT: 20, LOW RANGE: [], HIGH RANGE: [] +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128 + +// Executed Command: +// /Users/xiliangchen/projects/acala/target/release/acala +// benchmark +// --chain=dev +// --steps=50 +// --repeat=20 +// --pallet=module_currencies +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./currencies/src/weights.rs +// --template +// ../templates/orml-weight-template.hbs + + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(clippy::unnecessary_cast)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions needed for module_currencies. +pub trait WeightInfo { + fn transfer_non_native_currency() -> Weight; + fn transfer_native_currency() -> Weight; + fn update_balance_non_native_currency() -> Weight; + fn update_balance_native_currency_creating() -> Weight; + fn update_balance_native_currency_killing() -> Weight; +} + +/// Default weights. +impl WeightInfo for () { + fn transfer_non_native_currency() -> Weight { + (60_000_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(5 as Weight)) + .saturating_add(RocksDbWeight::get().writes(4 as Weight)) + } + fn transfer_native_currency() -> Weight { + (60_000_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(3 as Weight)) + .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + } + fn update_balance_non_native_currency() -> Weight { + (29_000_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(3 as Weight)) + .saturating_add(RocksDbWeight::get().writes(3 as Weight)) + } + fn update_balance_native_currency_creating() -> Weight { + (31_000_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + fn update_balance_native_currency_killing() -> Weight { + (37_000_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(3 as Weight)) + .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + } +} diff --git a/oracle/src/lib.rs b/oracle/src/lib.rs index 0716ff3b9..e17708f2c 100644 --- a/oracle/src/lib.rs +++ b/oracle/src/lib.rs @@ -42,21 +42,17 @@ use sp_std::{prelude::*, vec}; pub use crate::default_combine_data::DefaultCombineData; mod default_combine_data; -mod default_weight; mod mock; mod tests; +mod weights; pub use module::*; +pub use weights::WeightInfo; #[frame_support::pallet] pub mod module { use super::*; - pub trait WeightInfo { - fn feed_values(c: u32) -> Weight; - fn on_finalize() -> Weight; - } - pub(crate) type MomentOf = <>::Time as Time>::Moment; pub(crate) type TimestampedValueOf = TimestampedValue<>::OracleValue, MomentOf>; diff --git a/oracle/src/weights.rs b/oracle/src/weights.rs new file mode 100644 index 000000000..36447bdd5 --- /dev/null +++ b/oracle/src/weights.rs @@ -0,0 +1,51 @@ +//! Autogenerated weights for orml_oracle +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 +//! DATE: 2021-05-04, STEPS: [50, ], REPEAT: 20, LOW RANGE: [], HIGH RANGE: [] +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128 + +// Executed Command: +// /Users/xiliangchen/projects/acala/target/release/acala +// benchmark +// --chain=dev +// --steps=50 +// --repeat=20 +// --pallet=orml_oracle +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./oracle/src/weights.rs +// --template +// ../templates/orml-weight-template.hbs + + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(clippy::unnecessary_cast)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions needed for orml_oracle. +pub trait WeightInfo { + fn feed_values(c: u32, ) -> Weight; + fn on_finalize() -> Weight; +} + +/// Default weights. +impl WeightInfo for () { + fn feed_values(c: u32, ) -> Weight { + (16_800_000 as Weight) + // Standard Error: 84_000 + .saturating_add((3_600_000 as Weight).saturating_mul(c as Weight)) + .saturating_add(RocksDbWeight::get().reads(3 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + .saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(c as Weight))) + } + fn on_finalize() -> Weight { + (3_000_000 as Weight) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } +} diff --git a/tokens/src/default_weight.rs b/tokens/src/default_weight.rs deleted file mode 100644 index e46bf5656..000000000 --- a/tokens/src/default_weight.rs +++ /dev/null @@ -1,20 +0,0 @@ -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0 - -#![allow(unused_parens)] -#![allow(unused_imports)] -#![allow(clippy::unnecessary_cast)] - -use frame_support::weights::{constants::RocksDbWeight as DbWeight, Weight}; - -impl crate::WeightInfo for () { - fn transfer() -> Weight { - (158_835_000 as Weight) - .saturating_add(DbWeight::get().reads(4 as Weight)) - .saturating_add(DbWeight::get().writes(2 as Weight)) - } - fn transfer_all() -> Weight { - (162_545_000 as Weight) - .saturating_add(DbWeight::get().reads(4 as Weight)) - .saturating_add(DbWeight::get().writes(2 as Weight)) - } -} diff --git a/tokens/src/lib.rs b/tokens/src/lib.rs index f29e336b5..955b56856 100644 --- a/tokens/src/lib.rs +++ b/tokens/src/lib.rs @@ -70,10 +70,12 @@ use sp_std::{ vec::Vec, }; -mod default_weight; mod imbalances; mod mock; mod tests; +mod weights; + +pub use weights::WeightInfo; pub struct TransferDust(marker::PhantomData<(T, GetAccountId)>); impl OnDust for TransferDust @@ -150,11 +152,6 @@ pub use module::*; pub mod module { use super::*; - pub trait WeightInfo { - fn transfer() -> Weight; - fn transfer_all() -> Weight; - } - #[pallet::config] pub trait Config: frame_system::Config { type Event: From> + IsType<::Event>; diff --git a/tokens/src/weights.rs b/tokens/src/weights.rs new file mode 100644 index 000000000..5b6ed9474 --- /dev/null +++ b/tokens/src/weights.rs @@ -0,0 +1,49 @@ +//! Autogenerated weights for orml_tokens +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 +//! DATE: 2021-05-04, STEPS: [50, ], REPEAT: 20, LOW RANGE: [], HIGH RANGE: [] +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128 + +// Executed Command: +// /Users/xiliangchen/projects/acala/target/release/acala +// benchmark +// --chain=dev +// --steps=50 +// --repeat=20 +// --pallet=orml_tokens +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./tokens/src/weights.rs +// --template +// ../templates/orml-weight-template.hbs + + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(clippy::unnecessary_cast)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions needed for orml_tokens. +pub trait WeightInfo { + fn transfer() -> Weight; + fn transfer_all() -> Weight; +} + +/// Default weights. +impl WeightInfo for () { + fn transfer() -> Weight { + (60_000_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(5 as Weight)) + .saturating_add(RocksDbWeight::get().writes(4 as Weight)) + } + fn transfer_all() -> Weight { + (62_000_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(5 as Weight)) + .saturating_add(RocksDbWeight::get().writes(4 as Weight)) + } +} diff --git a/vesting/src/lib.rs b/vesting/src/lib.rs index bfce0556b..2d3db167d 100644 --- a/vesting/src/lib.rs +++ b/vesting/src/lib.rs @@ -44,11 +44,12 @@ use sp_std::{ vec::Vec, }; -mod default_weight; mod mock; mod tests; +mod weights; pub use module::*; +pub use weights::WeightInfo; /// The maximum number of vesting schedules an account can have. pub const MAX_VESTINGS: usize = 20; @@ -109,12 +110,6 @@ impl VestingSche pub mod module { use super::*; - pub trait WeightInfo { - fn vested_transfer() -> Weight; - fn claim(i: u32) -> Weight; - fn update_vesting_schedules(i: u32) -> Weight; - } - pub(crate) type BalanceOf = <::Currency as Currency<::AccountId>>::Balance; pub(crate) type VestingScheduleOf = VestingSchedule<::BlockNumber, BalanceOf>; diff --git a/vesting/src/weights.rs b/vesting/src/weights.rs new file mode 100644 index 000000000..0efb3bb8b --- /dev/null +++ b/vesting/src/weights.rs @@ -0,0 +1,59 @@ +//! Autogenerated weights for orml_vesting +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 +//! DATE: 2021-05-04, STEPS: [50, ], REPEAT: 20, LOW RANGE: [], HIGH RANGE: [] +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128 + +// Executed Command: +// /Users/xiliangchen/projects/acala/target/release/acala +// benchmark +// --chain=dev +// --steps=50 +// --repeat=20 +// --pallet=orml_vesting +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./vesting/src/weights.rs +// --template +// ../templates/orml-weight-template.hbs + + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(clippy::unnecessary_cast)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions needed for orml_vesting. +pub trait WeightInfo { + fn vested_transfer() -> Weight; + fn claim(i: u32, ) -> Weight; + fn update_vesting_schedules(i: u32, ) -> Weight; +} + +/// Default weights. +impl WeightInfo for () { + fn vested_transfer() -> Weight { + (69_000_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(4 as Weight)) + .saturating_add(RocksDbWeight::get().writes(4 as Weight)) + } + fn claim(i: u32, ) -> Weight { + (31_747_000 as Weight) + // Standard Error: 4_000 + .saturating_add((63_000 as Weight).saturating_mul(i as Weight)) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + } + fn update_vesting_schedules(i: u32, ) -> Weight { + (29_457_000 as Weight) + // Standard Error: 4_000 + .saturating_add((117_000 as Weight).saturating_mul(i as Weight)) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(3 as Weight)) + } +}