Skip to content

update weights for auction & authority #474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
23 changes: 0 additions & 23 deletions auction/src/default_weight.rs

This file was deleted.

8 changes: 2 additions & 6 deletions auction/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Event<Self>> + IsType<<Self as frame_system::Config>::Event>;
Expand Down
53 changes: 53 additions & 0 deletions auction/src/weights.rs
Original file line number Diff line number Diff line change
@@ -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)))
}
}
44 changes: 0 additions & 44 deletions authority/src/default_weight.rs

This file was deleted.

13 changes: 3 additions & 10 deletions authority/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down Expand Up @@ -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<T> = DelayedOrigin<<T as frame_system::Config>::BlockNumber, <T as Config>::PalletsOrigin>;
pub(crate) type CallOf<T> = <T as Config>::Call;
Expand Down
71 changes: 71 additions & 0 deletions authority/src/weights.rs
Original file line number Diff line number Diff line change
@@ -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))
}
}
11 changes: 2 additions & 9 deletions currencies/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T> =
<<T as Config>::MultiCurrency as MultiCurrency<<T as frame_system::Config>::AccountId>>::Balance;
pub(crate) type CurrencyIdOf<T> =
Expand Down
67 changes: 67 additions & 0 deletions currencies/src/weights.rs
Original file line number Diff line number Diff line change
@@ -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))
}
}
8 changes: 2 additions & 6 deletions oracle/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T, I = ()> = <<T as Config<I>>::Time as Time>::Moment;
pub(crate) type TimestampedValueOf<T, I = ()> = TimestampedValue<<T as Config<I>>::OracleValue, MomentOf<T, I>>;

Expand Down
Loading