Fix V2 PoV benchmarking (#13485)

* Bump default 'additional_trie_layers' to two

The default here only works for extremely small runtimes, which have
no more than 16 storage prefices. This is changed to a "sane" default
of 2, which is save for runtimes with up to 4096 storage prefices (eg StorageValue).

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update tests and test weights

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix PoV weights

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_balances

* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_message_queue

* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_glutton

* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_glutton

* Fix sanity check

>0 would also do as a check, but let's try this.

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: command-bot <>
This commit is contained in:
Oliver Tale-Yazdi
2023-02-28 14:47:36 +01:00
committed by GitHub
parent 033a0d01a4
commit 1eb0cd31b9
8 changed files with 576 additions and 477 deletions
+1 -1
View File
@@ -177,7 +177,7 @@ fn on_idle_weight_low_proof_is_close_enough_works() {
let ratio = Perbill::from_rational(got.proof_size(), should.proof_size());
// Just a sanity check here.
assert!(
ratio >= Perbill::from_percent(80),
ratio >= Perbill::from_percent(50),
"Too few proof size consumed, was only {:?} of expected",
ratio
);
+92 -92
View File
@@ -1,6 +1,6 @@
// This file is part of Substrate.
// Copyright (C) 2023 Parity Technologies (UK) Ltd.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,9 +18,9 @@
//! Autogenerated weights for pallet_glutton
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-02-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-02-28, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-ehxwxxsd-project-145-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024
// Executed Command:
@@ -33,7 +33,7 @@
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --json-file=/builds/parity/mirrors/substrate/.git/.artifacts/bench.json
// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/substrate/.git/.artifacts/bench.json
// --pallet=pallet_glutton
// --chain=dev
// --header=./HEADER-APACHE2
@@ -71,12 +71,12 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
fn initialize_pallet_grow(n: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `4`
// Estimated: `499`
// Minimum execution time: 9_248 nanoseconds.
Weight::from_ref_time(9_582_000)
.saturating_add(Weight::from_proof_size(499))
// Standard Error: 1_144
.saturating_add(Weight::from_ref_time(1_624_225).saturating_mul(n.into()))
// Estimated: `1489`
// Minimum execution time: 10_218 nanoseconds.
Weight::from_ref_time(10_510_000)
.saturating_add(Weight::from_proof_size(1489))
// Standard Error: 1_582
.saturating_add(Weight::from_ref_time(1_577_660).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into())))
@@ -89,12 +89,12 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
fn initialize_pallet_shrink(n: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `65`
// Estimated: `499`
// Minimum execution time: 10_210 nanoseconds.
Weight::from_ref_time(7_260_854)
.saturating_add(Weight::from_proof_size(499))
// Standard Error: 1_459
.saturating_add(Weight::from_ref_time(1_053_844).saturating_mul(n.into()))
// Estimated: `1489`
// Minimum execution time: 10_993 nanoseconds.
Weight::from_ref_time(11_208_000)
.saturating_add(Weight::from_proof_size(1489))
// Standard Error: 1_386
.saturating_add(Weight::from_ref_time(1_072_330).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into())))
@@ -104,11 +104,11 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 605 nanoseconds.
Weight::from_ref_time(1_102_112)
// Minimum execution time: 740 nanoseconds.
Weight::from_ref_time(770_000)
.saturating_add(Weight::from_proof_size(0))
// Standard Error: 28
.saturating_add(Weight::from_ref_time(120_597).saturating_mul(i.into()))
// Standard Error: 24
.saturating_add(Weight::from_ref_time(96_434).saturating_mul(i.into()))
}
/// Storage: Glutton TrashData (r:5000 w:0)
/// Proof: Glutton TrashData (max_values: Some(65000), max_size: Some(1036), added: 3016, mode: MaxEncodedLen)
@@ -116,12 +116,12 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
fn waste_proof_size_some(i: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `119036 + i * (1053 ±0)`
// Estimated: `0 + i * (3016 ±0)`
// Minimum execution time: 464 nanoseconds.
Weight::from_ref_time(552_000)
.saturating_add(Weight::from_proof_size(0))
// Standard Error: 1_962
.saturating_add(Weight::from_ref_time(5_780_304).saturating_mul(i.into()))
// Estimated: `990 + i * (3016 ±0)`
// Minimum execution time: 630 nanoseconds.
Weight::from_ref_time(712_000)
.saturating_add(Weight::from_proof_size(990))
// Standard Error: 4_326
.saturating_add(Weight::from_ref_time(5_500_880).saturating_mul(i.into()))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(i.into())))
.saturating_add(Weight::from_proof_size(3016).saturating_mul(i.into()))
}
@@ -129,31 +129,31 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Proof: Glutton Storage (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: Glutton Compute (r:1 w:0)
/// Proof: Glutton Compute (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: Glutton TrashData (r:1738 w:0)
/// Storage: Glutton TrashData (r:1737 w:0)
/// Proof: Glutton TrashData (max_values: Some(65000), max_size: Some(1036), added: 3016, mode: MaxEncodedLen)
fn on_idle_high_proof_waste() -> Weight {
// Proof Size summary in bytes:
// Measured: `1955391`
// Estimated: `5242806`
// Minimum execution time: 55_398_405 nanoseconds.
Weight::from_ref_time(55_594_848_000)
.saturating_add(Weight::from_proof_size(5242806))
.saturating_add(T::DbWeight::get().reads(1740_u64))
// Measured: `1954313`
// Estimated: `5242760`
// Minimum execution time: 56_743_236 nanoseconds.
Weight::from_ref_time(57_088_040_000)
.saturating_add(Weight::from_proof_size(5242760))
.saturating_add(T::DbWeight::get().reads(1739_u64))
}
/// Storage: Glutton Storage (r:1 w:0)
/// Proof: Glutton Storage (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: Glutton Compute (r:1 w:0)
/// Proof: Glutton Compute (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: Glutton TrashData (r:6 w:0)
/// Storage: Glutton TrashData (r:5 w:0)
/// Proof: Glutton TrashData (max_values: Some(65000), max_size: Some(1036), added: 3016, mode: MaxEncodedLen)
fn on_idle_low_proof_waste() -> Weight {
// Proof Size summary in bytes:
// Measured: `11717`
// Estimated: `19094`
// Minimum execution time: 98_888_667 nanoseconds.
Weight::from_ref_time(99_157_239_000)
.saturating_add(Weight::from_proof_size(19094))
.saturating_add(T::DbWeight::get().reads(8_u64))
// Measured: `9671`
// Estimated: `19048`
// Minimum execution time: 100_387_042 nanoseconds.
Weight::from_ref_time(100_987_577_000)
.saturating_add(Weight::from_proof_size(19048))
.saturating_add(T::DbWeight::get().reads(7_u64))
}
/// Storage: Glutton Storage (r:1 w:0)
/// Proof: Glutton Storage (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
@@ -162,10 +162,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
fn empty_on_idle() -> Weight {
// Proof Size summary in bytes:
// Measured: `4`
// Estimated: `998`
// Minimum execution time: 3_967 nanoseconds.
Weight::from_ref_time(4_121_000)
.saturating_add(Weight::from_proof_size(998))
// Estimated: `2978`
// Minimum execution time: 4_256 nanoseconds.
Weight::from_ref_time(4_447_000)
.saturating_add(Weight::from_proof_size(2978))
.saturating_add(T::DbWeight::get().reads(2_u64))
}
/// Storage: Glutton Compute (r:0 w:1)
@@ -174,8 +174,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 7_112 nanoseconds.
Weight::from_ref_time(7_484_000)
// Minimum execution time: 8_663 nanoseconds.
Weight::from_ref_time(8_864_000)
.saturating_add(Weight::from_proof_size(0))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -185,8 +185,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 7_056 nanoseconds.
Weight::from_ref_time(7_414_000)
// Minimum execution time: 8_653 nanoseconds.
Weight::from_ref_time(8_998_000)
.saturating_add(Weight::from_proof_size(0))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -202,12 +202,12 @@ impl WeightInfo for () {
fn initialize_pallet_grow(n: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `4`
// Estimated: `499`
// Minimum execution time: 9_248 nanoseconds.
Weight::from_ref_time(9_582_000)
.saturating_add(Weight::from_proof_size(499))
// Standard Error: 1_144
.saturating_add(Weight::from_ref_time(1_624_225).saturating_mul(n.into()))
// Estimated: `1489`
// Minimum execution time: 10_218 nanoseconds.
Weight::from_ref_time(10_510_000)
.saturating_add(Weight::from_proof_size(1489))
// Standard Error: 1_582
.saturating_add(Weight::from_ref_time(1_577_660).saturating_mul(n.into()))
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
.saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(n.into())))
@@ -220,12 +220,12 @@ impl WeightInfo for () {
fn initialize_pallet_shrink(n: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `65`
// Estimated: `499`
// Minimum execution time: 10_210 nanoseconds.
Weight::from_ref_time(7_260_854)
.saturating_add(Weight::from_proof_size(499))
// Standard Error: 1_459
.saturating_add(Weight::from_ref_time(1_053_844).saturating_mul(n.into()))
// Estimated: `1489`
// Minimum execution time: 10_993 nanoseconds.
Weight::from_ref_time(11_208_000)
.saturating_add(Weight::from_proof_size(1489))
// Standard Error: 1_386
.saturating_add(Weight::from_ref_time(1_072_330).saturating_mul(n.into()))
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
.saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(n.into())))
@@ -235,11 +235,11 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 605 nanoseconds.
Weight::from_ref_time(1_102_112)
// Minimum execution time: 740 nanoseconds.
Weight::from_ref_time(770_000)
.saturating_add(Weight::from_proof_size(0))
// Standard Error: 28
.saturating_add(Weight::from_ref_time(120_597).saturating_mul(i.into()))
// Standard Error: 24
.saturating_add(Weight::from_ref_time(96_434).saturating_mul(i.into()))
}
/// Storage: Glutton TrashData (r:5000 w:0)
/// Proof: Glutton TrashData (max_values: Some(65000), max_size: Some(1036), added: 3016, mode: MaxEncodedLen)
@@ -247,12 +247,12 @@ impl WeightInfo for () {
fn waste_proof_size_some(i: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `119036 + i * (1053 ±0)`
// Estimated: `0 + i * (3016 ±0)`
// Minimum execution time: 464 nanoseconds.
Weight::from_ref_time(552_000)
.saturating_add(Weight::from_proof_size(0))
// Standard Error: 1_962
.saturating_add(Weight::from_ref_time(5_780_304).saturating_mul(i.into()))
// Estimated: `990 + i * (3016 ±0)`
// Minimum execution time: 630 nanoseconds.
Weight::from_ref_time(712_000)
.saturating_add(Weight::from_proof_size(990))
// Standard Error: 4_326
.saturating_add(Weight::from_ref_time(5_500_880).saturating_mul(i.into()))
.saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(i.into())))
.saturating_add(Weight::from_proof_size(3016).saturating_mul(i.into()))
}
@@ -260,31 +260,31 @@ impl WeightInfo for () {
/// Proof: Glutton Storage (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: Glutton Compute (r:1 w:0)
/// Proof: Glutton Compute (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: Glutton TrashData (r:1738 w:0)
/// Storage: Glutton TrashData (r:1737 w:0)
/// Proof: Glutton TrashData (max_values: Some(65000), max_size: Some(1036), added: 3016, mode: MaxEncodedLen)
fn on_idle_high_proof_waste() -> Weight {
// Proof Size summary in bytes:
// Measured: `1955391`
// Estimated: `5242806`
// Minimum execution time: 55_398_405 nanoseconds.
Weight::from_ref_time(55_594_848_000)
.saturating_add(Weight::from_proof_size(5242806))
.saturating_add(RocksDbWeight::get().reads(1740_u64))
// Measured: `1954313`
// Estimated: `5242760`
// Minimum execution time: 56_743_236 nanoseconds.
Weight::from_ref_time(57_088_040_000)
.saturating_add(Weight::from_proof_size(5242760))
.saturating_add(RocksDbWeight::get().reads(1739_u64))
}
/// Storage: Glutton Storage (r:1 w:0)
/// Proof: Glutton Storage (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: Glutton Compute (r:1 w:0)
/// Proof: Glutton Compute (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: Glutton TrashData (r:6 w:0)
/// Storage: Glutton TrashData (r:5 w:0)
/// Proof: Glutton TrashData (max_values: Some(65000), max_size: Some(1036), added: 3016, mode: MaxEncodedLen)
fn on_idle_low_proof_waste() -> Weight {
// Proof Size summary in bytes:
// Measured: `11717`
// Estimated: `19094`
// Minimum execution time: 98_888_667 nanoseconds.
Weight::from_ref_time(99_157_239_000)
.saturating_add(Weight::from_proof_size(19094))
.saturating_add(RocksDbWeight::get().reads(8_u64))
// Measured: `9671`
// Estimated: `19048`
// Minimum execution time: 100_387_042 nanoseconds.
Weight::from_ref_time(100_987_577_000)
.saturating_add(Weight::from_proof_size(19048))
.saturating_add(RocksDbWeight::get().reads(7_u64))
}
/// Storage: Glutton Storage (r:1 w:0)
/// Proof: Glutton Storage (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
@@ -293,10 +293,10 @@ impl WeightInfo for () {
fn empty_on_idle() -> Weight {
// Proof Size summary in bytes:
// Measured: `4`
// Estimated: `998`
// Minimum execution time: 3_967 nanoseconds.
Weight::from_ref_time(4_121_000)
.saturating_add(Weight::from_proof_size(998))
// Estimated: `2978`
// Minimum execution time: 4_256 nanoseconds.
Weight::from_ref_time(4_447_000)
.saturating_add(Weight::from_proof_size(2978))
.saturating_add(RocksDbWeight::get().reads(2_u64))
}
/// Storage: Glutton Compute (r:0 w:1)
@@ -305,8 +305,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 7_112 nanoseconds.
Weight::from_ref_time(7_484_000)
// Minimum execution time: 8_663 nanoseconds.
Weight::from_ref_time(8_864_000)
.saturating_add(Weight::from_proof_size(0))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -316,8 +316,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 7_056 nanoseconds.
Weight::from_ref_time(7_414_000)
// Minimum execution time: 8_653 nanoseconds.
Weight::from_ref_time(8_998_000)
.saturating_add(Weight::from_proof_size(0))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}