Introduce sensible weight constants (#12868)

* Introduce sensible weight constants

* cargo fmt

* Remove unused import

* Add missing import

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

Co-authored-by: command-bot <>
This commit is contained in:
Keith Yeung
2022-12-09 01:18:51 +09:00
committed by GitHub
parent 200f49d66d
commit 51db8c77a7
26 changed files with 140 additions and 113 deletions
+29 -29
View File
@@ -18,7 +18,7 @@
//! Autogenerated weights for pallet_lottery
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-11-18, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2022-12-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024
@@ -67,33 +67,33 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: System Account (r:1 w:1)
// Storage: Lottery Tickets (r:0 w:1)
fn buy_ticket() -> Weight {
// Minimum execution time: 53_735 nanoseconds.
Weight::from_ref_time(54_235_000)
// Minimum execution time: 52_479 nanoseconds.
Weight::from_ref_time(53_225_000)
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(4))
}
// Storage: Lottery CallIndices (r:0 w:1)
/// The range of component `n` is `[0, 10]`.
fn set_calls(n: u32, ) -> Weight {
// Minimum execution time: 15_065 nanoseconds.
Weight::from_ref_time(16_467_398)
// Standard Error: 5_392
.saturating_add(Weight::from_ref_time(294_914).saturating_mul(n.into()))
// Minimum execution time: 14_433 nanoseconds.
Weight::from_ref_time(15_660_780)
// Standard Error: 5_894
.saturating_add(Weight::from_ref_time(290_482).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().writes(1))
}
// Storage: Lottery Lottery (r:1 w:1)
// Storage: Lottery LotteryIndex (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn start_lottery() -> Weight {
// Minimum execution time: 45_990 nanoseconds.
Weight::from_ref_time(46_789_000)
// Minimum execution time: 43_683 nanoseconds.
Weight::from_ref_time(44_580_000)
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
}
// Storage: Lottery Lottery (r:1 w:1)
fn stop_repeat() -> Weight {
// Minimum execution time: 10_783 nanoseconds.
Weight::from_ref_time(11_180_000)
// Minimum execution time: 10_514 nanoseconds.
Weight::from_ref_time(10_821_000)
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
@@ -103,8 +103,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: Lottery TicketsCount (r:1 w:1)
// Storage: Lottery Tickets (r:1 w:0)
fn on_initialize_end() -> Weight {
// Minimum execution time: 62_088 nanoseconds.
Weight::from_ref_time(63_670_000)
// Minimum execution time: 60_254 nanoseconds.
Weight::from_ref_time(61_924_000)
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(4))
}
@@ -115,8 +115,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: Lottery Tickets (r:1 w:0)
// Storage: Lottery LotteryIndex (r:1 w:1)
fn on_initialize_repeat() -> Weight {
// Minimum execution time: 64_953 nanoseconds.
Weight::from_ref_time(65_465_000)
// Minimum execution time: 61_552 nanoseconds.
Weight::from_ref_time(62_152_000)
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(5))
}
@@ -132,33 +132,33 @@ impl WeightInfo for () {
// Storage: System Account (r:1 w:1)
// Storage: Lottery Tickets (r:0 w:1)
fn buy_ticket() -> Weight {
// Minimum execution time: 53_735 nanoseconds.
Weight::from_ref_time(54_235_000)
// Minimum execution time: 52_479 nanoseconds.
Weight::from_ref_time(53_225_000)
.saturating_add(RocksDbWeight::get().reads(6))
.saturating_add(RocksDbWeight::get().writes(4))
}
// Storage: Lottery CallIndices (r:0 w:1)
/// The range of component `n` is `[0, 10]`.
fn set_calls(n: u32, ) -> Weight {
// Minimum execution time: 15_065 nanoseconds.
Weight::from_ref_time(16_467_398)
// Standard Error: 5_392
.saturating_add(Weight::from_ref_time(294_914).saturating_mul(n.into()))
// Minimum execution time: 14_433 nanoseconds.
Weight::from_ref_time(15_660_780)
// Standard Error: 5_894
.saturating_add(Weight::from_ref_time(290_482).saturating_mul(n.into()))
.saturating_add(RocksDbWeight::get().writes(1))
}
// Storage: Lottery Lottery (r:1 w:1)
// Storage: Lottery LotteryIndex (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn start_lottery() -> Weight {
// Minimum execution time: 45_990 nanoseconds.
Weight::from_ref_time(46_789_000)
// Minimum execution time: 43_683 nanoseconds.
Weight::from_ref_time(44_580_000)
.saturating_add(RocksDbWeight::get().reads(3))
.saturating_add(RocksDbWeight::get().writes(3))
}
// Storage: Lottery Lottery (r:1 w:1)
fn stop_repeat() -> Weight {
// Minimum execution time: 10_783 nanoseconds.
Weight::from_ref_time(11_180_000)
// Minimum execution time: 10_514 nanoseconds.
Weight::from_ref_time(10_821_000)
.saturating_add(RocksDbWeight::get().reads(1))
.saturating_add(RocksDbWeight::get().writes(1))
}
@@ -168,8 +168,8 @@ impl WeightInfo for () {
// Storage: Lottery TicketsCount (r:1 w:1)
// Storage: Lottery Tickets (r:1 w:0)
fn on_initialize_end() -> Weight {
// Minimum execution time: 62_088 nanoseconds.
Weight::from_ref_time(63_670_000)
// Minimum execution time: 60_254 nanoseconds.
Weight::from_ref_time(61_924_000)
.saturating_add(RocksDbWeight::get().reads(6))
.saturating_add(RocksDbWeight::get().writes(4))
}
@@ -180,8 +180,8 @@ impl WeightInfo for () {
// Storage: Lottery Tickets (r:1 w:0)
// Storage: Lottery LotteryIndex (r:1 w:1)
fn on_initialize_repeat() -> Weight {
// Minimum execution time: 64_953 nanoseconds.
Weight::from_ref_time(65_465_000)
// Minimum execution time: 61_552 nanoseconds.
Weight::from_ref_time(62_152_000)
.saturating_add(RocksDbWeight::get().reads(7))
.saturating_add(RocksDbWeight::get().writes(5))
}