Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Add missing weights #363

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .maintain/weights.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if [ "${RUNTIME}" == "bajun" ]; then
fi

cd "$(git rev-parse --show-toplevel)" || exit
cargo build-"${RUNTIME}"-benchmarks
cargo build-"${RUNTIME}"-benchmarks --features "experimental"

for PALLET in "${PALLETS[@]}"; do
./target/release/"${RUNTIME}"-para benchmark pallet \
Expand Down
1 change: 1 addition & 0 deletions runtime/ajuna/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ runtime-benchmarks = [
"pallet-xcm/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"staging-xcm-builder/runtime-benchmarks",
"cumulus-pallet-parachain-system/runtime-benchmarks",
"cumulus-pallet-session-benchmarking/runtime-benchmarks",
"cumulus-pallet-xcmp-queue/runtime-benchmarks",
]
Expand Down
13 changes: 11 additions & 2 deletions runtime/ajuna/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -921,11 +921,20 @@ impl_runtime_apis! {
fn dispatch_benchmark(
config: frame_benchmarking::BenchmarkConfig
) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {
use frame_benchmarking::{Benchmarking, BenchmarkBatch};
use frame_benchmarking::{BenchmarkError, Benchmarking, BenchmarkBatch};
use sp_storage::TrackedStorageKey;

use frame_system_benchmarking::Pallet as SystemBench;
impl frame_system_benchmarking::Config for Runtime {}
impl frame_system_benchmarking::Config for Runtime {
fn setup_set_code_requirements(code: &sp_std::vec::Vec<u8>) -> Result<(), BenchmarkError> {
ParachainSystem::initialize_for_set_code_benchmark(code.len() as u32);
Ok(())
}

fn verify_set_code() {
System::assert_last_event(cumulus_pallet_parachain_system::Event::<Runtime>::ValidationFunctionStored.into());
}
}

use cumulus_pallet_session_benchmarking::Pallet as SessionBench;
impl cumulus_pallet_session_benchmarking::Config for Runtime {}
Expand Down
97 changes: 57 additions & 40 deletions runtime/ajuna/src/weights/frame_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
//! Autogenerated weights for `frame_system`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-06-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-10-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `weight-calculation`, CPU: `DO-Regular`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024

// Executed Command:
// ./target/release/ajuna-para
Expand Down Expand Up @@ -53,82 +53,99 @@ impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 9_837_000 picoseconds.
Weight::from_parts(38_623_985, 0)
// Minimum execution time: 4_272_000 picoseconds.
Weight::from_parts(4_328_000, 0)
.saturating_add(Weight::from_parts(0, 0))
// Standard Error: 11
.saturating_add(Weight::from_parts(654, 0).saturating_mul(b.into()))
// Standard Error: 1
.saturating_add(Weight::from_parts(590, 0).saturating_mul(b.into()))
}
/// The range of component `b` is `[0, 3932160]`.
fn remark_with_event(b: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 16_604_000 picoseconds.
Weight::from_parts(16_883_000, 0)
// Minimum execution time: 13_722_000 picoseconds.
Weight::from_parts(14_025_000, 0)
.saturating_add(Weight::from_parts(0, 0))
// Standard Error: 11
.saturating_add(Weight::from_parts(2_890, 0).saturating_mul(b.into()))
// Standard Error: 3
.saturating_add(Weight::from_parts(2_335, 0).saturating_mul(b.into()))
}
/// Storage: System Digest (r:1 w:1)
/// Proof Skipped: System Digest (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: unknown `0x3a686561707061676573` (r:0 w:1)
/// Proof Skipped: unknown `0x3a686561707061676573` (r:0 w:1)
/// Storage: `System::Digest` (r:1 w:1)
/// Proof: `System::Digest` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: UNKNOWN KEY `0x3a686561707061676573` (r:0 w:1)
/// Proof: UNKNOWN KEY `0x3a686561707061676573` (r:0 w:1)
fn set_heap_pages() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `1485`
// Minimum execution time: 20_555_000 picoseconds.
Weight::from_parts(21_043_000, 0)
// Minimum execution time: 8_262_000 picoseconds.
Weight::from_parts(8_667_000, 0)
.saturating_add(Weight::from_parts(0, 1485))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(2))
}

/// Storage: `ParachainSystem::ValidationData` (r:1 w:0)
/// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `ParachainSystem::UpgradeRestrictionSignal` (r:1 w:0)
/// Proof: `ParachainSystem::UpgradeRestrictionSignal` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `ParachainSystem::PendingValidationCode` (r:1 w:1)
/// Proof: `ParachainSystem::PendingValidationCode` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0)
/// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `ParachainSystem::NewValidationCode` (r:0 w:1)
/// Proof: `ParachainSystem::NewValidationCode` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `ParachainSystem::DidSetValidationCode` (r:0 w:1)
/// Proof: `ParachainSystem::DidSetValidationCode` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
fn set_code() -> Weight {
todo!()
// Proof Size summary in bytes:
// Measured: `127`
// Estimated: `1612`
// Minimum execution time: 210_789_776_000 picoseconds.
Weight::from_parts(223_684_632_000, 0)
.saturating_add(Weight::from_parts(0, 1612))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}

/// Storage: Skipped Metadata (r:0 w:0)
/// Proof Skipped: Skipped Metadata (max_values: None, max_size: None, mode: Measured)
/// Storage: `Skipped::Metadata` (r:0 w:0)
/// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// The range of component `i` is `[0, 1000]`.
fn set_storage(i: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 5_347_000 picoseconds.
Weight::from_parts(6_852_000, 0)
// Minimum execution time: 4_108_000 picoseconds.
Weight::from_parts(4_215_000, 0)
.saturating_add(Weight::from_parts(0, 0))
// Standard Error: 31_635
.saturating_add(Weight::from_parts(2_621_621, 0).saturating_mul(i.into()))
// Standard Error: 12_017
.saturating_add(Weight::from_parts(1_408_195, 0).saturating_mul(i.into()))
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into())))
}
/// Storage: Skipped Metadata (r:0 w:0)
/// Proof Skipped: Skipped Metadata (max_values: None, max_size: None, mode: Measured)
/// Storage: `Skipped::Metadata` (r:0 w:0)
/// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// The range of component `i` is `[0, 1000]`.
fn kill_storage(i: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 5_192_000 picoseconds.
Weight::from_parts(5_285_000, 0)
// Minimum execution time: 4_064_000 picoseconds.
Weight::from_parts(4_107_000, 0)
.saturating_add(Weight::from_parts(0, 0))
// Standard Error: 22_327
.saturating_add(Weight::from_parts(1_630_247, 0).saturating_mul(i.into()))
// Standard Error: 3_074
.saturating_add(Weight::from_parts(934_338, 0).saturating_mul(i.into()))
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into())))
}
/// Storage: Skipped Metadata (r:0 w:0)
/// Proof Skipped: Skipped Metadata (max_values: None, max_size: None, mode: Measured)
/// Storage: `Skipped::Metadata` (r:0 w:0)
/// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// The range of component `p` is `[0, 1000]`.
fn kill_prefix(p: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `77 + p * (69 ±0)`
// Estimated: `71 + p * (70 ±0)`
// Minimum execution time: 9_232_000 picoseconds.
Weight::from_parts(9_389_000, 0)
.saturating_add(Weight::from_parts(0, 71))
// Standard Error: 35_804
.saturating_add(Weight::from_parts(3_159_587, 0).saturating_mul(p.into()))
// Measured: `82 + p * (69 ±0)`
// Estimated: `77 + p * (70 ±0)`
// Minimum execution time: 7_607_000 picoseconds.
Weight::from_parts(7_758_000, 0)
.saturating_add(Weight::from_parts(0, 77))
// Standard Error: 3_207
.saturating_add(Weight::from_parts(1_682_268, 0).saturating_mul(p.into()))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into())))
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into())))
.saturating_add(Weight::from_parts(0, 70).saturating_mul(p.into()))
Expand Down
34 changes: 28 additions & 6 deletions runtime/ajuna/src/weights/pallet_collator_selection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
//! Autogenerated weights for `pallet_collator_selection`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-06-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-10-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `weight-calculation`, CPU: `DO-Regular`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024

// Executed Command:
// ./target/release/ajuna-para
Expand Down Expand Up @@ -67,12 +67,34 @@ impl<T: frame_system::Config> pallet_collator_selection::WeightInfo for WeightIn
.saturating_add(Weight::from_parts(0, 2554).saturating_mul(b.into()))
}

fn add_invulnerable(_b: u32, _c: u32) -> Weight {
todo!()
fn add_invulnerable(b: u32, c: u32) -> Weight {
// Proof Size summary in bytes:
// Measured: `757 + b * (32 ±0) + c * (53 ±0)`
// Estimated: `6287 + b * (37 ±0) + c * (53 ±0)`
// Minimum execution time: 52_720_000 picoseconds.
Weight::from_parts(56_102_459, 0)
.saturating_add(Weight::from_parts(0, 6287))
// Standard Error: 12_957
.saturating_add(Weight::from_parts(26_422, 0).saturating_mul(b.into()))
// Standard Error: 2_456
.saturating_add(Weight::from_parts(128_528, 0).saturating_mul(c.into()))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
.saturating_add(Weight::from_parts(0, 37).saturating_mul(b.into()))
.saturating_add(Weight::from_parts(0, 53).saturating_mul(c.into()))
}

fn remove_invulnerable(_b: u32) -> Weight {
todo!()
fn remove_invulnerable(b: u32) -> Weight {
// Proof Size summary in bytes:
// Measured: `119 + b * (32 ±0)`
// Estimated: `4687`
// Minimum execution time: 183_054_000 picoseconds.
Weight::from_parts(197_205_427, 0)
.saturating_add(Weight::from_parts(0, 4687))
// Standard Error: 13_533
.saturating_add(Weight::from_parts(376_231, 0).saturating_mul(b.into()))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}

/// Storage: CollatorSelection DesiredCandidates (r:0 w:1)
Expand Down
1 change: 1 addition & 0 deletions runtime/bajun/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ runtime-benchmarks = [
"pallet-xcm/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"staging-xcm-builder/runtime-benchmarks",
"cumulus-pallet-parachain-system/runtime-benchmarks",
"cumulus-pallet-session-benchmarking/runtime-benchmarks",
"cumulus-pallet-xcmp-queue/runtime-benchmarks",
"pallet-ajuna-awesome-avatars-benchmarking/runtime-benchmarks",
Expand Down
13 changes: 11 additions & 2 deletions runtime/bajun/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1024,11 +1024,20 @@ impl_runtime_apis! {
fn dispatch_benchmark(
config: frame_benchmarking::BenchmarkConfig
) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {
use frame_benchmarking::{Benchmarking, BenchmarkBatch};
use frame_benchmarking::{BenchmarkError, Benchmarking, BenchmarkBatch};
use sp_storage::TrackedStorageKey;

use frame_system_benchmarking::Pallet as SystemBench;
impl frame_system_benchmarking::Config for Runtime {}
impl frame_system_benchmarking::Config for Runtime {
fn setup_set_code_requirements(code: &sp_std::vec::Vec<u8>) -> Result<(), BenchmarkError> {
ParachainSystem::initialize_for_set_code_benchmark(code.len() as u32);
Ok(())
}

fn verify_set_code() {
System::assert_last_event(cumulus_pallet_parachain_system::Event::<Runtime>::ValidationFunctionStored.into());
}
}

use cumulus_pallet_session_benchmarking::Pallet as SessionBench;
impl cumulus_pallet_session_benchmarking::Config for Runtime {}
Expand Down
Loading