Skip to content

Commit

Permalink
feat: backport weights to paseo
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelm41 committed Apr 18, 2024
1 parent 21e0d61 commit 61092e9
Show file tree
Hide file tree
Showing 4 changed files with 212 additions and 212 deletions.
74 changes: 37 additions & 37 deletions relay/paseo/constants/src/weights/block_weights.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// This file is part of Polkadot.
// This file is part of Paseo.

// Polkadot is free software: you can redistribute it and/or modify
// Paseo is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Polkadot is distributed in the hope that it will be useful,
// Paseo is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
// along with Paseo. If not, see <http://www.gnu.org/licenses/>.

//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-06-18 (Y/M/D)
Expand All @@ -39,43 +39,43 @@ use sp_core::parameter_types;
use sp_weights::{constants::WEIGHT_REF_TIME_PER_NANOS, Weight};

parameter_types! {
/// Time to execute an empty block.
/// Calculated by multiplying the *Average* with `1.0` and adding `0`.
///
/// Stats nanoseconds:
/// Min, Max: 13_546_462, 14_258_156
/// Average: 13_806_190
/// Median: 13_798_575
/// Std-Dev: 141568.11
///
/// Percentiles nanoseconds:
/// 99th: 14_144_016
/// 95th: 14_039_432
/// 75th: 13_904_965
pub const BlockExecutionWeight: Weight =
Weight::from_parts(WEIGHT_REF_TIME_PER_NANOS.saturating_mul(13_806_190), 0);
/// Time to execute an empty block.
/// Calculated by multiplying the *Average* with `1.0` and adding `0`.
///
/// Stats nanoseconds:
/// Min, Max: 13_546_462, 14_258_156
/// Average: 13_806_190
/// Median: 13_798_575
/// Std-Dev: 141568.11
///
/// Percentiles nanoseconds:
/// 99th: 14_144_016
/// 95th: 14_039_432
/// 75th: 13_904_965
pub const BlockExecutionWeight: Weight =
Weight::from_parts(WEIGHT_REF_TIME_PER_NANOS.saturating_mul(13_806_190), 0);
}

#[cfg(test)]
mod test_weights {
use sp_weights::constants;
use sp_weights::constants;

/// Checks that the weight exists and is sane.
// NOTE: If this test fails but you are sure that the generated values are fine,
// you can delete it.
#[test]
fn sane() {
let w = super::BlockExecutionWeight::get();
/// Checks that the weight exists and is sane.
// NOTE: If this test fails but you are sure that the generated values are fine,
// you can delete it.
#[test]
fn sane() {
let w = super::BlockExecutionWeight::get();

// At least 100 µs.
assert!(
w.ref_time() >= 100u64 * constants::WEIGHT_REF_TIME_PER_MICROS,
"Weight should be at least 100 µs."
);
// At most 50 ms.
assert!(
w.ref_time() <= 50u64 * constants::WEIGHT_REF_TIME_PER_MILLIS,
"Weight should be at most 50 ms."
);
}
// At least 100 µs.
assert!(
w.ref_time() >= 100u64 * constants::WEIGHT_REF_TIME_PER_MICROS,
"Weight should be at least 100 µs."
);
// At most 50 ms.
assert!(
w.ref_time() <= 50u64 * constants::WEIGHT_REF_TIME_PER_MILLIS,
"Weight should be at most 50 ms."
);
}
}
74 changes: 37 additions & 37 deletions relay/paseo/constants/src/weights/extrinsic_weights.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// This file is part of Polkadot.
// This file is part of Paseo.

// Polkadot is free software: you can redistribute it and/or modify
// Paseo is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Polkadot is distributed in the hope that it will be useful,
// Paseo is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
// along with Paseo. If not, see <http://www.gnu.org/licenses/>.

//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-06-18 (Y/M/D)
Expand All @@ -39,43 +39,43 @@ use sp_core::parameter_types;
use sp_weights::{constants::WEIGHT_REF_TIME_PER_NANOS, Weight};

parameter_types! {
/// Time to execute a NO-OP extrinsic, for example `System::remark`.
/// Calculated by multiplying the *Average* with `1.0` and adding `0`.
///
/// Stats nanoseconds:
/// Min, Max: 125_467, 127_402
/// Average: 126_045
/// Median: 126_039
/// Std-Dev: 310.96
///
/// Percentiles nanoseconds:
/// 99th: 126_699
/// 95th: 126_620
/// 75th: 126_207
pub const ExtrinsicBaseWeight: Weight =
Weight::from_parts(WEIGHT_REF_TIME_PER_NANOS.saturating_mul(126_045), 0);
/// Time to execute a NO-OP extrinsic, for example `System::remark`.
/// Calculated by multiplying the *Average* with `1.0` and adding `0`.
///
/// Stats nanoseconds:
/// Min, Max: 125_467, 127_402
/// Average: 126_045
/// Median: 126_039
/// Std-Dev: 310.96
///
/// Percentiles nanoseconds:
/// 99th: 126_699
/// 95th: 126_620
/// 75th: 126_207
pub const ExtrinsicBaseWeight: Weight =
Weight::from_parts(WEIGHT_REF_TIME_PER_NANOS.saturating_mul(126_045), 0);
}

#[cfg(test)]
mod test_weights {
use sp_weights::constants;
use sp_weights::constants;

/// Checks that the weight exists and is sane.
// NOTE: If this test fails but you are sure that the generated values are fine,
// you can delete it.
#[test]
fn sane() {
let w = super::ExtrinsicBaseWeight::get();
/// Checks that the weight exists and is sane.
// NOTE: If this test fails but you are sure that the generated values are fine,
// you can delete it.
#[test]
fn sane() {
let w = super::ExtrinsicBaseWeight::get();

// At least 10 µs.
assert!(
w.ref_time() >= 10u64 * constants::WEIGHT_REF_TIME_PER_MICROS,
"Weight should be at least 10 µs."
);
// At most 1 ms.
assert!(
w.ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
"Weight should be at most 1 ms."
);
}
// At least 10 µs.
assert!(
w.ref_time() >= 10u64 * constants::WEIGHT_REF_TIME_PER_MICROS,
"Weight should be at least 10 µs."
);
// At most 1 ms.
assert!(
w.ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
"Weight should be at most 1 ms."
);
}
}
138 changes: 69 additions & 69 deletions relay/paseo/constants/src/weights/paritydb_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-03-30 (Y/M/D)
//!
//! DATABASE: `ParityDb`, RUNTIME: `Polkadot`
//! DATABASE: `ParityDb`, RUNTIME: `Paseo`
//! BLOCK-NUM: `BlockId::Number(9653477)`
//! SKIP-WRITE: `false`, SKIP-READ: `false`, WARMUPS: `1`
//! STATE-VERSION: `V0`, STATE-CACHE-SIZE: `0`
Expand All @@ -33,77 +33,77 @@
// --mul=1.1
// --weight-path=runtime/polkadot/constants/src/weights/

/// Storage DB weights for the `Polkadot` runtime and `ParityDb`.
/// Storage DB weights for the `Paseo` runtime and `ParityDb`.
pub mod constants {
use frame_support::{
parameter_types,
weights::{constants, RuntimeDbWeight},
};
use frame_support::{
parameter_types,
weights::{constants, RuntimeDbWeight},
};

parameter_types! {
/// `ParityDB` can be enabled with a feature flag, but is still experimental. These weights
/// are available for brave runtime engineers who may want to try this out as default.
pub const ParityDbWeight: RuntimeDbWeight = RuntimeDbWeight {
// Time to read one storage item.
// Calculated by multiplying the *Average* of all values with `1.1` and adding `0`.
//
// Stats [NS]:
// Min, Max: 4_611, 13_478_005
// Average: 10_750
// Median: 10_655
// Std-Dev: 12214.49
//
// Percentiles [NS]:
// 99th: 14_451
// 95th: 12_588
// 75th: 11_200
read: 11_826 * constants::WEIGHT_REF_TIME_PER_NANOS,
parameter_types! {
/// `ParityDB` can be enabled with a feature flag, but is still experimental. These weights
/// are available for brave runtime engineers who may want to try this out as default.
pub const ParityDbWeight: RuntimeDbWeight = RuntimeDbWeight {
// Time to read one storage item.
// Calculated by multiplying the *Average* of all values with `1.1` and adding `0`.
//
// Stats [NS]:
// Min, Max: 4_611, 13_478_005
// Average: 10_750
// Median: 10_655
// Std-Dev: 12214.49
//
// Percentiles [NS]:
// 99th: 14_451
// 95th: 12_588
// 75th: 11_200
read: 11_826 * constants::WEIGHT_REF_TIME_PER_NANOS,

// Time to write one storage item.
// Calculated by multiplying the *Average* of all values with `1.1` and adding `0`.
//
// Stats [NS]:
// Min, Max: 8_023, 47_367_740
// Average: 34_592
// Median: 32_703
// Std-Dev: 49417.24
//
// Percentiles [NS]:
// 99th: 69_379
// 95th: 47_168
// 75th: 35_252
write: 38_052 * constants::WEIGHT_REF_TIME_PER_NANOS,
};
}
// Time to write one storage item.
// Calculated by multiplying the *Average* of all values with `1.1` and adding `0`.
//
// Stats [NS]:
// Min, Max: 8_023, 47_367_740
// Average: 34_592
// Median: 32_703
// Std-Dev: 49417.24
//
// Percentiles [NS]:
// 99th: 69_379
// 95th: 47_168
// 75th: 35_252
write: 38_052 * constants::WEIGHT_REF_TIME_PER_NANOS,
};
}

#[cfg(test)]
mod test_db_weights {
use super::constants::ParityDbWeight as W;
use frame_support::weights::constants;
#[cfg(test)]
mod test_db_weights {
use super::constants::ParityDbWeight as W;
use frame_support::weights::constants;

/// Checks that all weights exist and have sane values.
// NOTE: If this test fails but you are sure that the generated values are fine,
// you can delete it.
#[test]
fn bound() {
// At least 1 µs.
assert!(
W::get().reads(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS,
"Read weight should be at least 1 µs."
);
assert!(
W::get().writes(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS,
"Write weight should be at least 1 µs."
);
// At most 1 ms.
assert!(
W::get().reads(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
"Read weight should be at most 1 ms."
);
assert!(
W::get().writes(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
"Write weight should be at most 1 ms."
);
}
}
/// Checks that all weights exist and have sane values.
// NOTE: If this test fails but you are sure that the generated values are fine,
// you can delete it.
#[test]
fn bound() {
// At least 1 µs.
assert!(
W::get().reads(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS,
"Read weight should be at least 1 µs."
);
assert!(
W::get().writes(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS,
"Write weight should be at least 1 µs."
);
// At most 1 ms.
assert!(
W::get().reads(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
"Read weight should be at most 1 ms."
);
assert!(
W::get().writes(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
"Write weight should be at most 1 ms."
);
}
}
}
Loading

0 comments on commit 61092e9

Please sign in to comment.