Skip to content

Commit 4323a56

Browse files
echevrierechevriermosonyi
authored
Updated weights: Benchmark on DO droplet (#91)
* Running Benchmarks for teeracle pallet * Add missing pallets * Benchmark on DO droplet (#65) * Update hardware specifications and Readme Co-authored-by: echevrier <[email protected]> Co-authored-by: Zoltan Mosonyi <[email protected]>
1 parent fbebb0c commit 4323a56

14 files changed

+219
-208
lines changed

README.md

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,26 @@ A substrate-based node that maintains a registry of remote attested integritee-s
77
## Build and Run
88
Please see our [Integritee Book](https://book.integritee.network/howto_node.html) to learn how to build and run this.
99

10-
## benchmarking of weights
10+
## Benchmark the runtimes
11+
In `./scripts` we have a script for benchmarking the runtimes.
1112

12-
```
13-
cargo build --release --features=runtime-benchmarks
14-
./scripts/benchmark_all_pallets.sh
15-
```
13+
### Current benchmark
14+
The current weights have been benchmarked with the following reference hardware:
15+
16+
GenuineIntel CPU MHz: 2494.144
17+
8GB of RAM
18+
NVMe SSD
19+
20+
### Running benchmark
21+
1. Compile the node with: `cargo build --release --features runtime-benchmarks`
22+
2. run: `./scripts/benchmark_all_pallets.sh`.
23+
3. If changed, update the reference hardware above.
24+
25+
### Adding new pallets to be benchmarked
26+
Every pallet with a `type WeightInfo` parameter in its config must be benchmarked.
27+
28+
1. [Cargo.toml] add `<new_pallet>/runtime-benchmarks` in the `runtime-benchmarks` feature section.
29+
2. [runtime] add the new pallet to the `list_benchmark!` and `add_benchmark!` list.
30+
3. add the new pallet in the script `./scripts/benchmark_all_pallets.sh` and run it.
31+
4. [runtime/src/weights] add the new file to the modules
32+
5. [runtime] replace the placeholder `type WeightInfo = ()` with `type WeightInfo = weights::<new_pallet>::WeightInfo<Runtime>`

runtime/src/weights/frame_system.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
//! Autogenerated weights for `frame_system`
33
//!
44
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
5-
//! DATE: 2021-10-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
5+
//! DATE: 2021-11-11, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
66
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("integritee-solo-fresh"), DB CACHE: 128
77
88
// Executed Command:
9-
// target/release/integritee-node
9+
// ./integritee-node
1010
// benchmark
1111
// --chain=integritee-solo-fresh
1212
// --steps=50
@@ -30,46 +30,46 @@ use sp_std::marker::PhantomData;
3030
pub struct WeightInfo<T>(PhantomData<T>);
3131
impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> {
3232
fn remark(b: u32, ) -> Weight {
33-
(574_000 as Weight)
33+
(0 as Weight)
3434
// Standard Error: 0
35-
.saturating_add((1_000 as Weight).saturating_mul(b as Weight))
35+
.saturating_add((2_000 as Weight).saturating_mul(b as Weight))
3636
}
3737
fn remark_with_event(b: u32, ) -> Weight {
38-
(2_653_000 as Weight)
38+
(0 as Weight)
3939
// Standard Error: 0
40-
.saturating_add((2_000 as Weight).saturating_mul(b as Weight))
40+
.saturating_add((3_000 as Weight).saturating_mul(b as Weight))
4141
}
4242
// Storage: unknown [0x3a686561707061676573] (r:0 w:1)
4343
fn set_heap_pages() -> Weight {
44-
(1_567_000 as Weight)
44+
(2_273_000 as Weight)
4545
.saturating_add(T::DbWeight::get().writes(1 as Weight))
4646
}
4747
// Storage: System Digest (r:1 w:1)
4848
// Storage: unknown [0x3a6368616e6765735f74726965] (r:0 w:1)
4949
fn set_changes_trie_config() -> Weight {
50-
(6_236_000 as Weight)
50+
(27_085_000 as Weight)
5151
.saturating_add(T::DbWeight::get().reads(1 as Weight))
5252
.saturating_add(T::DbWeight::get().writes(2 as Weight))
5353
}
5454
// Storage: Skipped Metadata (r:0 w:0)
5555
fn set_storage(i: u32, ) -> Weight {
5656
(0 as Weight)
57-
// Standard Error: 0
58-
.saturating_add((838_000 as Weight).saturating_mul(i as Weight))
57+
// Standard Error: 5_000
58+
.saturating_add((1_457_000 as Weight).saturating_mul(i as Weight))
5959
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight)))
6060
}
6161
// Storage: Skipped Metadata (r:0 w:0)
6262
fn kill_storage(i: u32, ) -> Weight {
63-
(2_052_000 as Weight)
64-
// Standard Error: 0
65-
.saturating_add((556_000 as Weight).saturating_mul(i as Weight))
63+
(6_118_000 as Weight)
64+
// Standard Error: 5_000
65+
.saturating_add((1_007_000 as Weight).saturating_mul(i as Weight))
6666
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight)))
6767
}
6868
// Storage: Skipped Metadata (r:0 w:0)
6969
fn kill_prefix(p: u32, ) -> Weight {
70-
(3_140_000 as Weight)
71-
// Standard Error: 0
72-
.saturating_add((756_000 as Weight).saturating_mul(p as Weight))
70+
(0 as Weight)
71+
// Standard Error: 8_000
72+
.saturating_add((3_208_000 as Weight).saturating_mul(p as Weight))
7373
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(p as Weight)))
7474
}
7575
}

runtime/src/weights/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//! The weights used in the runtime
22
//!
33
//! The current weights have been obtained with the following reference hardware:
4-
//! * Intel(R) Xeon(R) E-2276G CPU @ 3.80 GHz
5-
//! * 32GB of RAM
6-
//! * 1TB SSD Samsung 860 EVO Basic, 2.5"
4+
//! * GenuineIntel CPU MHz: 2494.144
5+
//! * 8GB of RAM
6+
//! * NVMe SSD
77
88
// the generated files to not pass clippy
99
#![allow(clippy::all)]

runtime/src/weights/pallet_balances.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
//! Autogenerated weights for `pallet_balances`
33
//!
44
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
5-
//! DATE: 2021-10-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
5+
//! DATE: 2021-11-11, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
66
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("integritee-solo-fresh"), DB CACHE: 128
77
88
// Executed Command:
9-
// target/release/integritee-node
9+
// ./integritee-node
1010
// benchmark
1111
// --chain=integritee-solo-fresh
1212
// --steps=50
@@ -31,37 +31,37 @@ pub struct WeightInfo<T>(PhantomData<T>);
3131
impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> {
3232
// Storage: System Account (r:1 w:1)
3333
fn transfer() -> Weight {
34-
(68_344_000 as Weight)
34+
(134_486_000 as Weight)
3535
.saturating_add(T::DbWeight::get().reads(1 as Weight))
3636
.saturating_add(T::DbWeight::get().writes(1 as Weight))
3737
}
3838
// Storage: System Account (r:1 w:1)
3939
fn transfer_keep_alive() -> Weight {
40-
(50_479_000 as Weight)
40+
(103_768_000 as Weight)
4141
.saturating_add(T::DbWeight::get().reads(1 as Weight))
4242
.saturating_add(T::DbWeight::get().writes(1 as Weight))
4343
}
4444
// Storage: System Account (r:1 w:1)
4545
fn set_balance_creating() -> Weight {
46-
(27_005_000 as Weight)
46+
(70_179_000 as Weight)
4747
.saturating_add(T::DbWeight::get().reads(1 as Weight))
4848
.saturating_add(T::DbWeight::get().writes(1 as Weight))
4949
}
5050
// Storage: System Account (r:1 w:1)
5151
fn set_balance_killing() -> Weight {
52-
(33_450_000 as Weight)
52+
(77_886_000 as Weight)
5353
.saturating_add(T::DbWeight::get().reads(1 as Weight))
5454
.saturating_add(T::DbWeight::get().writes(1 as Weight))
5555
}
5656
// Storage: System Account (r:2 w:2)
5757
fn force_transfer() -> Weight {
58-
(68_560_000 as Weight)
58+
(135_123_000 as Weight)
5959
.saturating_add(T::DbWeight::get().reads(2 as Weight))
6060
.saturating_add(T::DbWeight::get().writes(2 as Weight))
6161
}
6262
// Storage: System Account (r:1 w:1)
6363
fn transfer_all() -> Weight {
64-
(62_591_000 as Weight)
64+
(120_544_000 as Weight)
6565
.saturating_add(T::DbWeight::get().reads(1 as Weight))
6666
.saturating_add(T::DbWeight::get().writes(1 as Weight))
6767
}

runtime/src/weights/pallet_claims.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
//! Autogenerated weights for `pallet_claims`
33
//!
44
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
5-
//! DATE: 2021-10-19, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
5+
//! DATE: 2021-11-11, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
66
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("integritee-solo-fresh"), DB CACHE: 128
77
88
// Executed Command:
9-
// target/release/integritee-node
9+
// ./integritee-node
1010
// benchmark
1111
// --chain=integritee-solo-fresh
1212
// --steps=50
@@ -37,7 +37,7 @@ impl<T: frame_system::Config> pallet_claims::WeightInfo for WeightInfo<T> {
3737
// Storage: System Account (r:1 w:0)
3838
// Storage: Balances Locks (r:1 w:1)
3939
fn claim() -> Weight {
40-
(430_312_000 as Weight)
40+
(761_780_000 as Weight)
4141
.saturating_add(T::DbWeight::get().reads(7 as Weight))
4242
.saturating_add(T::DbWeight::get().writes(6 as Weight))
4343
}
@@ -46,7 +46,7 @@ impl<T: frame_system::Config> pallet_claims::WeightInfo for WeightInfo<T> {
4646
// Storage: Claims Claims (r:0 w:1)
4747
// Storage: Claims Signing (r:0 w:1)
4848
fn mint_claim() -> Weight {
49-
(12_008_000 as Weight)
49+
(27_006_000 as Weight)
5050
.saturating_add(T::DbWeight::get().reads(1 as Weight))
5151
.saturating_add(T::DbWeight::get().writes(4 as Weight))
5252
}
@@ -58,7 +58,7 @@ impl<T: frame_system::Config> pallet_claims::WeightInfo for WeightInfo<T> {
5858
// Storage: System Account (r:1 w:0)
5959
// Storage: Balances Locks (r:1 w:1)
6060
fn claim_attest() -> Weight {
61-
(434_315_000 as Weight)
61+
(775_524_000 as Weight)
6262
.saturating_add(T::DbWeight::get().reads(7 as Weight))
6363
.saturating_add(T::DbWeight::get().writes(6 as Weight))
6464
}
@@ -71,7 +71,7 @@ impl<T: frame_system::Config> pallet_claims::WeightInfo for WeightInfo<T> {
7171
// Storage: System Account (r:1 w:0)
7272
// Storage: Balances Locks (r:1 w:1)
7373
fn attest() -> Weight {
74-
(106_371_000 as Weight)
74+
(310_377_000 as Weight)
7575
.saturating_add(T::DbWeight::get().reads(8 as Weight))
7676
.saturating_add(T::DbWeight::get().writes(7 as Weight))
7777
}
@@ -80,7 +80,7 @@ impl<T: frame_system::Config> pallet_claims::WeightInfo for WeightInfo<T> {
8080
// Storage: Claims Signing (r:1 w:2)
8181
// Storage: Claims Preclaims (r:1 w:1)
8282
fn move_claim() -> Weight {
83-
(25_219_000 as Weight)
83+
(64_975_000 as Weight)
8484
.saturating_add(T::DbWeight::get().reads(4 as Weight))
8585
.saturating_add(T::DbWeight::get().writes(7 as Weight))
8686
}

runtime/src/weights/pallet_multisig.rs

Lines changed: 33 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
//! Autogenerated weights for `pallet_multisig`
33
//!
44
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
5-
//! DATE: 2021-10-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
5+
//! DATE: 2021-11-11, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
66
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("integritee-solo-fresh"), DB CACHE: 128
77
88
// Executed Command:
9-
// target/release/integritee-node
9+
// ./integritee-node
1010
// benchmark
1111
// --chain=integritee-solo-fresh
1212
// --steps=50
@@ -30,100 +30,94 @@ use sp_std::marker::PhantomData;
3030
pub struct WeightInfo<T>(PhantomData<T>);
3131
impl<T: frame_system::Config> pallet_multisig::WeightInfo for WeightInfo<T> {
3232
fn as_multi_threshold_1(z: u32, ) -> Weight {
33-
(5_896_000 as Weight)
33+
(9_050_000 as Weight)
3434
// Standard Error: 0
35-
.saturating_add((1_000 as Weight).saturating_mul(z as Weight))
35+
.saturating_add((3_000 as Weight).saturating_mul(z as Weight))
3636
}
3737
// Storage: Multisig Multisigs (r:1 w:1)
3838
// Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0)
3939
fn as_multi_create(s: u32, z: u32, ) -> Weight {
40-
(47_432_000 as Weight)
41-
// Standard Error: 7_000
42-
.saturating_add((285_000 as Weight).saturating_mul(s as Weight))
40+
(99_228_000 as Weight)
41+
// Standard Error: 87_000
42+
.saturating_add((793_000 as Weight).saturating_mul(s as Weight))
4343
// Standard Error: 0
44-
.saturating_add((2_000 as Weight).saturating_mul(z as Weight))
44+
.saturating_add((3_000 as Weight).saturating_mul(z as Weight))
4545
.saturating_add(T::DbWeight::get().reads(2 as Weight))
4646
.saturating_add(T::DbWeight::get().writes(1 as Weight))
4747
}
4848
// Storage: Multisig Multisigs (r:1 w:1)
4949
// Storage: Multisig Calls (r:1 w:1)
5050
// Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0)
5151
fn as_multi_create_store(s: u32, z: u32, ) -> Weight {
52-
(51_683_000 as Weight)
53-
// Standard Error: 8_000
54-
.saturating_add((408_000 as Weight).saturating_mul(s as Weight))
52+
(111_754_000 as Weight)
53+
// Standard Error: 282_000
54+
.saturating_add((956_000 as Weight).saturating_mul(s as Weight))
5555
// Standard Error: 0
56-
.saturating_add((3_000 as Weight).saturating_mul(z as Weight))
56+
.saturating_add((6_000 as Weight).saturating_mul(z as Weight))
5757
.saturating_add(T::DbWeight::get().reads(3 as Weight))
5858
.saturating_add(T::DbWeight::get().writes(2 as Weight))
5959
}
6060
// Storage: Multisig Multisigs (r:1 w:1)
61-
fn as_multi_approve(s: u32, z: u32, ) -> Weight {
62-
(28_039_000 as Weight)
63-
// Standard Error: 6_000
64-
.saturating_add((236_000 as Weight).saturating_mul(s as Weight))
61+
fn as_multi_approve(_s: u32, z: u32, ) -> Weight {
62+
(70_439_000 as Weight)
6563
// Standard Error: 0
66-
.saturating_add((2_000 as Weight).saturating_mul(z as Weight))
64+
.saturating_add((3_000 as Weight).saturating_mul(z as Weight))
6765
.saturating_add(T::DbWeight::get().reads(1 as Weight))
6866
.saturating_add(T::DbWeight::get().writes(1 as Weight))
6967
}
7068
// Storage: Multisig Multisigs (r:1 w:1)
7169
// Storage: Multisig Calls (r:1 w:1)
7270
fn as_multi_approve_store(s: u32, z: u32, ) -> Weight {
73-
(50_363_000 as Weight)
74-
// Standard Error: 9_000
75-
.saturating_add((356_000 as Weight).saturating_mul(s as Weight))
71+
(87_141_000 as Weight)
72+
// Standard Error: 329_000
73+
.saturating_add((2_115_000 as Weight).saturating_mul(s as Weight))
7674
// Standard Error: 0
77-
.saturating_add((3_000 as Weight).saturating_mul(z as Weight))
75+
.saturating_add((7_000 as Weight).saturating_mul(z as Weight))
7876
.saturating_add(T::DbWeight::get().reads(2 as Weight))
7977
.saturating_add(T::DbWeight::get().writes(2 as Weight))
8078
}
8179
// Storage: Multisig Multisigs (r:1 w:1)
8280
// Storage: Multisig Calls (r:1 w:1)
8381
// Storage: System Account (r:1 w:1)
8482
fn as_multi_complete(s: u32, z: u32, ) -> Weight {
85-
(65_416_000 as Weight)
86-
// Standard Error: 9_000
87-
.saturating_add((459_000 as Weight).saturating_mul(s as Weight))
83+
(139_018_000 as Weight)
84+
// Standard Error: 317_000
85+
.saturating_add((629_000 as Weight).saturating_mul(s as Weight))
8886
// Standard Error: 0
89-
.saturating_add((4_000 as Weight).saturating_mul(z as Weight))
87+
.saturating_add((9_000 as Weight).saturating_mul(z as Weight))
9088
.saturating_add(T::DbWeight::get().reads(3 as Weight))
9189
.saturating_add(T::DbWeight::get().writes(3 as Weight))
9290
}
9391
// Storage: Multisig Multisigs (r:1 w:1)
9492
// Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0)
9593
fn approve_as_multi_create(s: u32, ) -> Weight {
96-
(45_215_000 as Weight)
97-
// Standard Error: 15_000
98-
.saturating_add((484_000 as Weight).saturating_mul(s as Weight))
94+
(93_678_000 as Weight)
95+
// Standard Error: 75_000
96+
.saturating_add((1_063_000 as Weight).saturating_mul(s as Weight))
9997
.saturating_add(T::DbWeight::get().reads(2 as Weight))
10098
.saturating_add(T::DbWeight::get().writes(1 as Weight))
10199
}
102100
// Storage: Multisig Multisigs (r:1 w:1)
103101
// Storage: Multisig Calls (r:1 w:0)
104-
fn approve_as_multi_approve(s: u32, ) -> Weight {
105-
(27_906_000 as Weight)
106-
// Standard Error: 28_000
107-
.saturating_add((138_000 as Weight).saturating_mul(s as Weight))
102+
fn approve_as_multi_approve(_s: u32, ) -> Weight {
103+
(81_581_000 as Weight)
108104
.saturating_add(T::DbWeight::get().reads(2 as Weight))
109105
.saturating_add(T::DbWeight::get().writes(1 as Weight))
110106
}
111107
// Storage: Multisig Multisigs (r:1 w:1)
112108
// Storage: Multisig Calls (r:1 w:1)
113109
// Storage: System Account (r:1 w:1)
114110
fn approve_as_multi_complete(s: u32, ) -> Weight {
115-
(107_320_000 as Weight)
116-
// Standard Error: 13_000
117-
.saturating_add((483_000 as Weight).saturating_mul(s as Weight))
111+
(235_769_000 as Weight)
112+
// Standard Error: 197_000
113+
.saturating_add((1_684_000 as Weight).saturating_mul(s as Weight))
118114
.saturating_add(T::DbWeight::get().reads(3 as Weight))
119115
.saturating_add(T::DbWeight::get().writes(3 as Weight))
120116
}
121117
// Storage: Multisig Multisigs (r:1 w:1)
122118
// Storage: Multisig Calls (r:1 w:1)
123-
fn cancel_as_multi(s: u32, ) -> Weight {
124-
(79_773_000 as Weight)
125-
// Standard Error: 9_000
126-
.saturating_add((383_000 as Weight).saturating_mul(s as Weight))
119+
fn cancel_as_multi(_s: u32, ) -> Weight {
120+
(194_725_000 as Weight)
127121
.saturating_add(T::DbWeight::get().reads(2 as Weight))
128122
.saturating_add(T::DbWeight::get().writes(2 as Weight))
129123
}

0 commit comments

Comments
 (0)