Skip to content

Commit f4ea091

Browse files
authored
Updated db weights and some experiments (paritytech#1732)
* updated weights * also fix off-by-one in benchmarks
1 parent 7f7ac92 commit f4ea091

File tree

5 files changed

+52
-51
lines changed

5 files changed

+52
-51
lines changed

modules/grandpa/src/weights.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
//! Autogenerated weights for `pallet_bridge_grandpa`
1818
//!
1919
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
20-
//! DATE: 2022-11-17, STEPS: 50, REPEAT: 20
20+
//! DATE: 2022-12-21, STEPS: 50, REPEAT: 20
2121
//! LOW RANGE: [], HIGH RANGE: []
2222
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled
2323
//! CHAIN: Some("dev"), DB CACHE: 1024
@@ -59,21 +59,21 @@ pub trait WeightInfo {
5959
pub struct BridgeWeight<T>(PhantomData<T>);
6060
impl<T: frame_system::Config> WeightInfo for BridgeWeight<T> {
6161
fn submit_finality_proof(p: u32, v: u32) -> Weight {
62-
Weight::from_ref_time(198_274_668 as u64)
63-
.saturating_add(Weight::from_ref_time(39_830_948 as u64).saturating_mul(p as u64))
64-
.saturating_add(Weight::from_ref_time(1_535_681 as u64).saturating_mul(v as u64))
65-
.saturating_add(T::DbWeight::get().reads(7 as u64))
62+
Weight::from_ref_time(192_130_822 as u64)
63+
.saturating_add(Weight::from_ref_time(39_781_096 as u64).saturating_mul(p as u64))
64+
.saturating_add(Weight::from_ref_time(1_365_108 as u64).saturating_mul(v as u64))
65+
.saturating_add(T::DbWeight::get().reads(6 as u64))
6666
.saturating_add(T::DbWeight::get().writes(6 as u64))
6767
}
6868
}
6969

7070
// For backwards compatibility and tests
7171
impl WeightInfo for () {
7272
fn submit_finality_proof(p: u32, v: u32) -> Weight {
73-
Weight::from_ref_time(198_274_668 as u64)
74-
.saturating_add(Weight::from_ref_time(39_830_948 as u64).saturating_mul(p as u64))
75-
.saturating_add(Weight::from_ref_time(1_535_681 as u64).saturating_mul(v as u64))
76-
.saturating_add(RocksDbWeight::get().reads(7 as u64))
73+
Weight::from_ref_time(192_130_822 as u64)
74+
.saturating_add(Weight::from_ref_time(39_781_096 as u64).saturating_mul(p as u64))
75+
.saturating_add(Weight::from_ref_time(1_365_108 as u64).saturating_mul(v as u64))
76+
.saturating_add(RocksDbWeight::get().reads(6 as u64))
7777
.saturating_add(RocksDbWeight::get().writes(6 as u64))
7878
}
7979
}

modules/messages/src/weights.rs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
//! Autogenerated weights for `pallet_bridge_messages`
1818
//!
1919
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
20-
//! DATE: 2022-11-17, STEPS: 50, REPEAT: 20
20+
//! DATE: 2022-12-21, STEPS: 50, REPEAT: 20
2121
//! LOW RANGE: [], HIGH RANGE: []
2222
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled
2323
//! CHAIN: Some("dev"), DB CACHE: 1024
@@ -66,87 +66,87 @@ pub trait WeightInfo {
6666
pub struct BridgeWeight<T>(PhantomData<T>);
6767
impl<T: frame_system::Config> WeightInfo for BridgeWeight<T> {
6868
fn receive_single_message_proof() -> Weight {
69-
Weight::from_ref_time(50_596_000 as u64)
69+
Weight::from_ref_time(60_148_000 as u64)
7070
.saturating_add(T::DbWeight::get().reads(4 as u64))
7171
.saturating_add(T::DbWeight::get().writes(2 as u64))
7272
}
7373
fn receive_two_messages_proof() -> Weight {
74-
Weight::from_ref_time(77_041_000 as u64)
74+
Weight::from_ref_time(71_836_000 as u64)
7575
.saturating_add(T::DbWeight::get().reads(4 as u64))
7676
.saturating_add(T::DbWeight::get().writes(2 as u64))
7777
}
7878
fn receive_single_message_proof_with_outbound_lane_state() -> Weight {
79-
Weight::from_ref_time(58_331_000 as u64)
79+
Weight::from_ref_time(66_845_000 as u64)
8080
.saturating_add(T::DbWeight::get().reads(4 as u64))
8181
.saturating_add(T::DbWeight::get().writes(2 as u64))
8282
}
8383
fn receive_single_message_proof_1_kb() -> Weight {
84-
Weight::from_ref_time(48_061_000 as u64)
84+
Weight::from_ref_time(69_696_000 as u64)
8585
.saturating_add(T::DbWeight::get().reads(3 as u64))
8686
.saturating_add(T::DbWeight::get().writes(1 as u64))
8787
}
8888
fn receive_single_message_proof_16_kb() -> Weight {
89-
Weight::from_ref_time(101_601_000 as u64)
89+
Weight::from_ref_time(123_646_000 as u64)
9090
.saturating_add(T::DbWeight::get().reads(3 as u64))
9191
.saturating_add(T::DbWeight::get().writes(1 as u64))
9292
}
9393
fn receive_delivery_proof_for_single_message() -> Weight {
94-
Weight::from_ref_time(55_108_000 as u64)
94+
Weight::from_ref_time(53_723_000 as u64)
9595
.saturating_add(T::DbWeight::get().reads(4 as u64))
9696
.saturating_add(T::DbWeight::get().writes(2 as u64))
9797
}
9898
fn receive_delivery_proof_for_two_messages_by_single_relayer() -> Weight {
99-
Weight::from_ref_time(53_917_000 as u64)
99+
Weight::from_ref_time(54_617_000 as u64)
100100
.saturating_add(T::DbWeight::get().reads(4 as u64))
101101
.saturating_add(T::DbWeight::get().writes(2 as u64))
102102
}
103103
fn receive_delivery_proof_for_two_messages_by_two_relayers() -> Weight {
104-
Weight::from_ref_time(57_335_000 as u64)
105-
.saturating_add(T::DbWeight::get().reads(5 as u64))
106-
.saturating_add(T::DbWeight::get().writes(3 as u64))
104+
Weight::from_ref_time(53_582_000 as u64)
105+
.saturating_add(T::DbWeight::get().reads(4 as u64))
106+
.saturating_add(T::DbWeight::get().writes(2 as u64))
107107
}
108108
}
109109

110110
// For backwards compatibility and tests
111111
impl WeightInfo for () {
112112
fn receive_single_message_proof() -> Weight {
113-
Weight::from_ref_time(50_596_000 as u64)
113+
Weight::from_ref_time(60_148_000 as u64)
114114
.saturating_add(RocksDbWeight::get().reads(4 as u64))
115115
.saturating_add(RocksDbWeight::get().writes(2 as u64))
116116
}
117117
fn receive_two_messages_proof() -> Weight {
118-
Weight::from_ref_time(77_041_000 as u64)
118+
Weight::from_ref_time(71_836_000 as u64)
119119
.saturating_add(RocksDbWeight::get().reads(4 as u64))
120120
.saturating_add(RocksDbWeight::get().writes(2 as u64))
121121
}
122122
fn receive_single_message_proof_with_outbound_lane_state() -> Weight {
123-
Weight::from_ref_time(58_331_000 as u64)
123+
Weight::from_ref_time(66_845_000 as u64)
124124
.saturating_add(RocksDbWeight::get().reads(4 as u64))
125125
.saturating_add(RocksDbWeight::get().writes(2 as u64))
126126
}
127127
fn receive_single_message_proof_1_kb() -> Weight {
128-
Weight::from_ref_time(48_061_000 as u64)
128+
Weight::from_ref_time(69_696_000 as u64)
129129
.saturating_add(RocksDbWeight::get().reads(3 as u64))
130130
.saturating_add(RocksDbWeight::get().writes(1 as u64))
131131
}
132132
fn receive_single_message_proof_16_kb() -> Weight {
133-
Weight::from_ref_time(101_601_000 as u64)
133+
Weight::from_ref_time(123_646_000 as u64)
134134
.saturating_add(RocksDbWeight::get().reads(3 as u64))
135135
.saturating_add(RocksDbWeight::get().writes(1 as u64))
136136
}
137137
fn receive_delivery_proof_for_single_message() -> Weight {
138-
Weight::from_ref_time(55_108_000 as u64)
138+
Weight::from_ref_time(53_723_000 as u64)
139139
.saturating_add(RocksDbWeight::get().reads(4 as u64))
140140
.saturating_add(RocksDbWeight::get().writes(2 as u64))
141141
}
142142
fn receive_delivery_proof_for_two_messages_by_single_relayer() -> Weight {
143-
Weight::from_ref_time(53_917_000 as u64)
143+
Weight::from_ref_time(54_617_000 as u64)
144144
.saturating_add(RocksDbWeight::get().reads(4 as u64))
145145
.saturating_add(RocksDbWeight::get().writes(2 as u64))
146146
}
147147
fn receive_delivery_proof_for_two_messages_by_two_relayers() -> Weight {
148-
Weight::from_ref_time(57_335_000 as u64)
149-
.saturating_add(RocksDbWeight::get().reads(5 as u64))
150-
.saturating_add(RocksDbWeight::get().writes(3 as u64))
148+
Weight::from_ref_time(53_582_000 as u64)
149+
.saturating_add(RocksDbWeight::get().reads(4 as u64))
150+
.saturating_add(RocksDbWeight::get().writes(2 as u64))
151151
}
152152
}

modules/parachains/src/benchmarking.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@ benchmarks_instance_pallet! {
5959

6060
let sender = account("sender", 0, 0);
6161
let mut parachains = T::parachains();
62-
let _ = parachains.split_off(p as usize - 1);
62+
let _ = if p <= parachains.len() as u32 {
63+
parachains.split_off(p as usize)
64+
} else {
65+
Default::default()
66+
};
67+
log::trace!(target: crate::LOG_TARGET, "=== {:?}", parachains.len());
6368
let (relay_block_number, relay_block_hash, parachain_heads_proof, parachains_heads) = T::prepare_parachain_heads_proof(
6469
&parachains,
6570
DEFAULT_PARACHAIN_HEAD_SIZE,

modules/parachains/src/weights.rs

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
//! Autogenerated weights for `pallet_bridge_parachains`
1818
//!
1919
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
20-
//! DATE: 2022-11-17, STEPS: 50, REPEAT: 20
20+
//! DATE: 2022-12-21, STEPS: 50, REPEAT: 20
2121
//! LOW RANGE: [], HIGH RANGE: []
2222
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled
2323
//! CHAIN: Some("dev"), DB CACHE: 1024
@@ -60,41 +60,37 @@ pub trait WeightInfo {
6060
/// Those weights are test only and must never be used in production.
6161
pub struct BridgeWeight<T>(PhantomData<T>);
6262
impl<T: frame_system::Config> WeightInfo for BridgeWeight<T> {
63-
fn submit_parachain_heads_with_n_parachains(p: u32) -> Weight {
64-
Weight::from_ref_time(51_173_000 as u64)
65-
.saturating_add(Weight::from_ref_time(24_495_968 as u64).saturating_mul(p as u64))
66-
.saturating_add(T::DbWeight::get().reads(2 as u64))
67-
.saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(p as u64)))
68-
.saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(p as u64)))
63+
fn submit_parachain_heads_with_n_parachains(_p: u32) -> Weight {
64+
Weight::from_ref_time(52_445_014 as u64)
65+
.saturating_add(T::DbWeight::get().reads(4 as u64))
66+
.saturating_add(T::DbWeight::get().writes(3 as u64))
6967
}
7068
fn submit_parachain_heads_with_1kb_proof() -> Weight {
71-
Weight::from_ref_time(58_175_000 as u64)
69+
Weight::from_ref_time(55_253_000 as u64)
7270
.saturating_add(T::DbWeight::get().reads(4 as u64))
7371
.saturating_add(T::DbWeight::get().writes(3 as u64))
7472
}
7573
fn submit_parachain_heads_with_16kb_proof() -> Weight {
76-
Weight::from_ref_time(101_796_000 as u64)
74+
Weight::from_ref_time(98_772_000 as u64)
7775
.saturating_add(T::DbWeight::get().reads(4 as u64))
7876
.saturating_add(T::DbWeight::get().writes(3 as u64))
7977
}
8078
}
8179

8280
// For backwards compatibility and tests
8381
impl WeightInfo for () {
84-
fn submit_parachain_heads_with_n_parachains(p: u32) -> Weight {
85-
Weight::from_ref_time(51_173_000 as u64)
86-
.saturating_add(Weight::from_ref_time(24_495_968 as u64).saturating_mul(p as u64))
87-
.saturating_add(RocksDbWeight::get().reads(2 as u64))
88-
.saturating_add(RocksDbWeight::get().reads((2 as u64).saturating_mul(p as u64)))
89-
.saturating_add(RocksDbWeight::get().writes((3 as u64).saturating_mul(p as u64)))
82+
fn submit_parachain_heads_with_n_parachains(_p: u32) -> Weight {
83+
Weight::from_ref_time(52_445_014 as u64)
84+
.saturating_add(RocksDbWeight::get().reads(4 as u64))
85+
.saturating_add(RocksDbWeight::get().writes(3 as u64))
9086
}
9187
fn submit_parachain_heads_with_1kb_proof() -> Weight {
92-
Weight::from_ref_time(58_175_000 as u64)
88+
Weight::from_ref_time(55_253_000 as u64)
9389
.saturating_add(RocksDbWeight::get().reads(4 as u64))
9490
.saturating_add(RocksDbWeight::get().writes(3 as u64))
9591
}
9692
fn submit_parachain_heads_with_16kb_proof() -> Weight {
97-
Weight::from_ref_time(101_796_000 as u64)
93+
Weight::from_ref_time(98_772_000 as u64)
9894
.saturating_add(RocksDbWeight::get().reads(4 as u64))
9995
.saturating_add(RocksDbWeight::get().writes(3 as u64))
10096
}

modules/relayers/src/weights.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
//! Autogenerated weights for `pallet_bridge_relayers`
1818
//!
1919
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
20-
//! DATE: 2022-12-05, STEPS: 50, REPEAT: 20
20+
//! DATE: 2022-12-21, STEPS: 50, REPEAT: 20
2121
//! LOW RANGE: [], HIGH RANGE: []
2222
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled
2323
//! CHAIN: Some("dev"), DB CACHE: 1024
@@ -59,7 +59,7 @@ pub trait WeightInfo {
5959
pub struct BridgeWeight<T>(PhantomData<T>);
6060
impl<T: frame_system::Config> WeightInfo for BridgeWeight<T> {
6161
fn claim_rewards() -> Weight {
62-
Weight::from_ref_time(64_065_000 as u64)
62+
Weight::from_ref_time(64_832_000 as u64)
6363
.saturating_add(T::DbWeight::get().reads(2 as u64))
6464
.saturating_add(T::DbWeight::get().writes(2 as u64))
6565
}
@@ -68,7 +68,7 @@ impl<T: frame_system::Config> WeightInfo for BridgeWeight<T> {
6868
// For backwards compatibility and tests
6969
impl WeightInfo for () {
7070
fn claim_rewards() -> Weight {
71-
Weight::from_ref_time(64_065_000 as u64)
71+
Weight::from_ref_time(64_832_000 as u64)
7272
.saturating_add(RocksDbWeight::get().reads(2 as u64))
7373
.saturating_add(RocksDbWeight::get().writes(2 as u64))
7474
}

0 commit comments

Comments
 (0)