Skip to content

Commit

Permalink
[runtime] run actual benchmarks for the mbm
Browse files Browse the repository at this point in the history
  • Loading branch information
clangenb committed Apr 23, 2024
1 parent 4828945 commit 8be8a4c
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 10 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion runtime/bajun/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1031,10 +1031,13 @@ mod benches {
// [pallet_treasury, Treasury] // treasury config is broken, needs fixes
[pallet_utility, Utility]
[pallet_ajuna_awesome_avatars, AwesomeAvatarsBench::<Runtime>]
// Note: We have to update the path to the `WeightInfo` definition after
// running the benchmarks: `pallet_ajuna_awesome_avatars::migration::v6::WeightInfo`
[pallet_ajuna_awesome_avatars_mbm, AwesomeAvatars]
[pallet_nfts, Nft]
);
// Use this section if you want to benchmark individual pallets
// define_benchmarks!([pallet_migrations, Migrations]);
// define_benchmarks!([pallet_ajuna_awesome_avatars_mbm, AwesomeAvatars]);
}

#[cfg(feature = "runtime-benchmarks")]
Expand Down
46 changes: 42 additions & 4 deletions runtime/bajun/src/weights/pallet_ajuna_awesome_avatars_mbm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,57 @@ use core::marker::PhantomData;

/// Weight functions for `pallet_ajuna_awesome_avatars_mbm`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_ajuna_awesome_avatars::migration::v6::weights::WeightInfo for WeightInfo<T> {
impl<T: frame_system::Config> pallet_ajuna_awesome_avatars::migration::v6::WeightInfo for WeightInfo<T> {
/// Storage: `AwesomeAvatars::PlayerSeasonConfigs` (r:2 w:1)
/// Proof: `AwesomeAvatars::PlayerSeasonConfigs` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`)
/// Storage: `AwesomeAvatars::TradeStatsMap` (r:0 w:1)
/// Proof: `AwesomeAvatars::TradeStatsMap` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`)
fn step() -> Weight {
fn player_season_configs_step() -> Weight {
// Proof Size summary in bytes:
// Measured: `156`
// Estimated: `6048`
// Minimum execution time: 26_500_000 picoseconds.
Weight::from_parts(27_800_000, 0)
// Minimum execution time: 26_000_000 picoseconds.
Weight::from_parts(57_200_000, 0)
.saturating_add(Weight::from_parts(0, 6048))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `AwesomeAvatars::SeasonStats` (r:2 w:1)
/// Proof: `AwesomeAvatars::SeasonStats` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`)
/// Storage: `AwesomeAvatars::TradeStatsMap` (r:1 w:1)
/// Proof: `AwesomeAvatars::TradeStatsMap` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`)
fn season_stats_step() -> Weight {
// Proof Size summary in bytes:
// Measured: `199`
// Estimated: `6048`
// Minimum execution time: 33_700_000 picoseconds.
Weight::from_parts(35_600_000, 0)
.saturating_add(Weight::from_parts(0, 6048))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `AwesomeAvatars::Avatars` (r:2 w:1)
/// Proof: `AwesomeAvatars::Avatars` (`max_values`: None, `max_size`: Some(177), added: 2652, mode: `MaxEncodedLen`)
fn avatar_step() -> Weight {
// Proof Size summary in bytes:
// Measured: `168`
// Estimated: `6294`
// Minimum execution time: 24_200_000 picoseconds.
Weight::from_parts(27_500_000, 0)
.saturating_add(Weight::from_parts(0, 6294))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `AwesomeAvatars::TradeStatsMap` (r:2 w:1)
/// Proof: `AwesomeAvatars::TradeStatsMap` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`)
fn trade_stats_map_cleanup_step() -> Weight {
// Proof Size summary in bytes:
// Measured: `136`
// Estimated: `6024`
// Minimum execution time: 25_900_000 picoseconds.
Weight::from_parts(32_200_000, 0)
.saturating_add(Weight::from_parts(0, 6024))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
}

0 comments on commit 8be8a4c

Please sign in to comment.