difftreelog
fix benchmark compile
in: master
3 files changed
pallets/nonfungible/src/benchmarking.rsdiffbeforeafterboth1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617use super::*;18use crate::{Pallet, Config, NonfungibleHandle};1920use sp_std::prelude::*;21use pallet_common::benchmarking::{create_collection_raw, property_key, property_value};22use frame_benchmarking::{benchmarks, account};23use up_data_structs::{CollectionMode, MAX_ITEMS_PER_BATCH, MAX_PROPERTIES_PER_ITEM, budget::Unlimited};24use pallet_common::bench_init;2526const SEED: u32 = 1;2728fn create_max_item_data<T: Config>(owner: T::CrossAccountId) -> CreateItemData<T> {29 CreateItemData::<T> {30 owner,31 properties: Default::default(),32 }33}34fn create_max_item<T: Config>(35 collection: &NonfungibleHandle<T>,36 sender: &T::CrossAccountId,37 owner: T::CrossAccountId,38) -> Result<TokenId, DispatchError> {39 <Pallet<T>>::create_item(40 &collection,41 sender,42 create_max_item_data::<T>(owner),43 &Unlimited,44 )?;45 Ok(TokenId(<TokensMinted<T>>::get(&collection.id)))46}4748fn create_collection<T: Config>(49 owner: T::CrossAccountId,50) -> Result<NonfungibleHandle<T>, DispatchError> {51 create_collection_raw(52 owner,53 CollectionMode::NFT,54 |owner, data| <Pallet<T>>::init_collection(owner, data, true),55 NonfungibleHandle::cast,56 )57}5859benchmarks! {60 create_item {61 bench_init!{62 owner: sub; collection: collection(owner);63 sender: cross_from_sub(owner); to: cross_sub;64 };65 }: {create_max_item(&collection, &sender, to.clone())?}6667 create_multiple_items {68 let b in 0..MAX_ITEMS_PER_BATCH;69 bench_init!{70 owner: sub; collection: collection(owner);71 sender: cross_from_sub(owner); to: cross_sub;72 };73 let data = (0..b).map(|_| create_max_item_data::<T>(to.clone())).collect();74 }: {<Pallet<T>>::create_multiple_items(&collection, &sender, data, &Unlimited)?}7576 create_multiple_items_ex {77 let b in 0..MAX_ITEMS_PER_BATCH;78 bench_init!{79 owner: sub; collection: collection(owner);80 sender: cross_from_sub(owner);81 };82 let data = (0..b).map(|i| {83 bench_init!(to: cross_sub(i););84 create_max_item_data::<T>(to)85 }).collect();86 }: {<Pallet<T>>::create_multiple_items(&collection, &sender, data, &Unlimited)?}8788 burn_item {89 bench_init!{90 owner: sub; collection: collection(owner);91 sender: cross_from_sub(owner); burner: cross_sub;92 };93 let item = create_max_item(&collection, &sender, burner.clone())?;94 }: {<Pallet<T>>::burn(&collection, &burner, item)?}9596 burn_recursively_self_raw {97 bench_init!{98 owner: sub; collection: collection(owner);99 sender: cross_from_sub(owner); burner: cross_sub;100 };101 let item = create_max_item(&collection, &sender, burner.clone())?;102 }: {<Pallet<T>>::burn_recursively(&collection, &burner, item, &Unlimited, &Unlimited)?}103104 burn_recursively_breadth_plus_self_plus_self_per_each_raw {105 let b in 0..200;106 bench_init!{107 owner: sub; collection: collection(owner);108 sender: cross_from_sub(owner); burner: cross_sub;109 };110 let item = create_max_item(&collection, &sender, burner.clone())?;111 for i in 0..b {112 create_max_item(&collection, &sender, T::CrossTokenAddressMapping::token_to_address(collection.id, item))?;113 }114 }: {<Pallet<T>>::burn_recursively(&collection, &burner, item, &Unlimited, &Unlimited)?}115116 transfer {117 bench_init!{118 owner: sub; collection: collection(owner);119 owner: cross_from_sub; sender: cross_sub; receiver: cross_sub;120 };121 let item = create_max_item(&collection, &owner, sender.clone())?;122 }: {<Pallet<T>>::transfer(&collection, &sender, &receiver, item, &Unlimited)?}123124 approve {125 bench_init!{126 owner: sub; collection: collection(owner);127 owner: cross_from_sub; sender: cross_sub; spender: cross_sub;128 };129 let item = create_max_item(&collection, &owner, sender.clone())?;130 }: {<Pallet<T>>::set_allowance(&collection, &sender, item, Some(&spender))?}131132 transfer_from {133 bench_init!{134 owner: sub; collection: collection(owner);135 owner: cross_from_sub; sender: cross_sub; spender: cross_sub; receiver: cross_sub;136 };137 let item = create_max_item(&collection, &owner, sender.clone())?;138 <Pallet<T>>::set_allowance(&collection, &sender, item, Some(&spender))?;139 }: {<Pallet<T>>::transfer_from(&collection, &spender, &sender, &receiver, item, &Unlimited)?}140141 burn_from {142 bench_init!{143 owner: sub; collection: collection(owner);144 owner: cross_from_sub; sender: cross_sub; burner: cross_sub;145 };146 let item = create_max_item(&collection, &owner, sender.clone())?;147 <Pallet<T>>::set_allowance(&collection, &sender, item, Some(&burner))?;148 }: {<Pallet<T>>::burn_from(&collection, &burner, &sender, item, &Unlimited)?}149150 set_token_property_permissions {151 let b in 0..MAX_PROPERTIES_PER_ITEM;152 bench_init!{153 owner: sub; collection: collection(owner);154 owner: cross_from_sub;155 };156 let perms = (0..b).map(|k| PropertyKeyPermission {157 key: property_key(k as usize),158 permission: PropertyPermission {159 mutable: false,160 collection_admin: false,161 token_owner: false,162 },163 }).collect::<Vec<_>>();164 }: {<Pallet<T>>::set_token_property_permissions(&collection, &owner, perms)?}165166 set_token_properties {167 let b in 0..MAX_PROPERTIES_PER_ITEM;168 bench_init!{169 owner: sub; collection: collection(owner);170 owner: cross_from_sub;171 };172 let perms = (0..b).map(|k| PropertyKeyPermission {173 key: property_key(k as usize),174 permission: PropertyPermission {175 mutable: false,176 collection_admin: true,177 token_owner: true,178 },179 }).collect::<Vec<_>>();180 <Pallet<T>>::set_token_property_permissions(&collection, &owner, perms)?;181 let props = (0..b).map(|k| Property {182 key: property_key(k as usize),183 value: property_value(),184 }).collect::<Vec<_>>();185 let item = create_max_item(&collection, &owner, owner.clone())?;186 }: {<Pallet<T>>::set_token_properties(&collection, &owner, item, props, false, &Unlimited)?}187188 delete_token_properties {189 let b in 0..MAX_PROPERTIES_PER_ITEM;190 bench_init!{191 owner: sub; collection: collection(owner);192 owner: cross_from_sub;193 };194 let perms = (0..b).map(|k| PropertyKeyPermission {195 key: property_key(k as usize),196 permission: PropertyPermission {197 mutable: true,198 collection_admin: true,199 token_owner: true,200 },201 }).collect::<Vec<_>>();202 <Pallet<T>>::set_token_property_permissions(&collection, &owner, perms)?;203 let props = (0..b).map(|k| Property {204 key: property_key(k as usize),205 value: property_value(),206 }).collect::<Vec<_>>();207 let item = create_max_item(&collection, &owner, owner.clone())?;208 <Pallet<T>>::set_token_properties(&collection, &owner, item, props, false, &Unlimited)?;209 let to_delete = (0..b).map(|k| property_key(k as usize)).collect::<Vec<_>>();210 }: {<Pallet<T>>::delete_token_properties(&collection, &owner, item, to_delete, &Unlimited)?}211}1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617use super::*;18use crate::{Pallet, Config, NonfungibleHandle};1920use sp_std::prelude::*;21use pallet_common::benchmarking::{create_collection_raw, property_key, property_value};22use frame_benchmarking::{benchmarks, account};23use up_data_structs::{CollectionMode, MAX_ITEMS_PER_BATCH, MAX_PROPERTIES_PER_ITEM, budget::Unlimited};24use pallet_common::bench_init;2526const SEED: u32 = 1;2728fn create_max_item_data<T: Config>(owner: T::CrossAccountId) -> CreateItemData<T> {29 CreateItemData::<T> {30 owner,31 properties: Default::default(),32 }33}34fn create_max_item<T: Config>(35 collection: &NonfungibleHandle<T>,36 sender: &T::CrossAccountId,37 owner: T::CrossAccountId,38) -> Result<TokenId, DispatchError> {39 <Pallet<T>>::create_item(40 &collection,41 sender,42 create_max_item_data::<T>(owner),43 &Unlimited,44 )?;45 Ok(TokenId(<TokensMinted<T>>::get(&collection.id)))46}4748fn create_collection<T: Config>(49 owner: T::CrossAccountId,50) -> Result<NonfungibleHandle<T>, DispatchError> {51 create_collection_raw(52 owner,53 CollectionMode::NFT,54 |owner, data| <Pallet<T>>::init_collection(owner, data, true),55 NonfungibleHandle::cast,56 )57}5859benchmarks! {60 create_item {61 bench_init!{62 owner: sub; collection: collection(owner);63 sender: cross_from_sub(owner); to: cross_sub;64 };65 }: {create_max_item(&collection, &sender, to.clone())?}6667 create_multiple_items {68 let b in 0..MAX_ITEMS_PER_BATCH;69 bench_init!{70 owner: sub; collection: collection(owner);71 sender: cross_from_sub(owner); to: cross_sub;72 };73 let data = (0..b).map(|_| create_max_item_data::<T>(to.clone())).collect();74 }: {<Pallet<T>>::create_multiple_items(&collection, &sender, data, &Unlimited)?}7576 create_multiple_items_ex {77 let b in 0..MAX_ITEMS_PER_BATCH;78 bench_init!{79 owner: sub; collection: collection(owner);80 sender: cross_from_sub(owner);81 };82 let data = (0..b).map(|i| {83 bench_init!(to: cross_sub(i););84 create_max_item_data::<T>(to)85 }).collect();86 }: {<Pallet<T>>::create_multiple_items(&collection, &sender, data, &Unlimited)?}8788 burn_item {89 bench_init!{90 owner: sub; collection: collection(owner);91 sender: cross_from_sub(owner); burner: cross_sub;92 };93 let item = create_max_item(&collection, &sender, burner.clone())?;94 }: {<Pallet<T>>::burn(&collection, &burner, item)?}9596 burn_recursively_self_raw {97 bench_init!{98 owner: sub; collection: collection(owner);99 sender: cross_from_sub(owner); burner: cross_sub;100 };101 let item = create_max_item(&collection, &sender, burner.clone())?;102 }: {<Pallet<T>>::burn_recursively(&collection, &burner, item, &Unlimited, &Unlimited)?}103104 burn_recursively_breadth_plus_self_plus_self_per_each_raw {105 let b in 0..200;106 bench_init!{107 owner: sub; collection: collection(owner);108 sender: cross_from_sub(owner); burner: cross_sub;109 };110 let item = create_max_item(&collection, &sender, burner.clone())?;111 for i in 0..b {112 create_max_item(&collection, &sender, T::CrossTokenAddressMapping::token_to_address(collection.id, item))?;113 }114 }: {<Pallet<T>>::burn_recursively(&collection, &burner, item, &Unlimited, &Unlimited)?}115116 transfer {117 bench_init!{118 owner: sub; collection: collection(owner);119 owner: cross_from_sub; sender: cross_sub; receiver: cross_sub;120 };121 let item = create_max_item(&collection, &owner, sender.clone())?;122 }: {<Pallet<T>>::transfer(&collection, &sender, &receiver, item, &Unlimited)?}123124 approve {125 bench_init!{126 owner: sub; collection: collection(owner);127 owner: cross_from_sub; sender: cross_sub; spender: cross_sub;128 };129 let item = create_max_item(&collection, &owner, sender.clone())?;130 }: {<Pallet<T>>::set_allowance(&collection, &sender, item, Some(&spender))?}131132 transfer_from {133 bench_init!{134 owner: sub; collection: collection(owner);135 owner: cross_from_sub; sender: cross_sub; spender: cross_sub; receiver: cross_sub;136 };137 let item = create_max_item(&collection, &owner, sender.clone())?;138 <Pallet<T>>::set_allowance(&collection, &sender, item, Some(&spender))?;139 }: {<Pallet<T>>::transfer_from(&collection, &spender, &sender, &receiver, item, &Unlimited)?}140141 burn_from {142 bench_init!{143 owner: sub; collection: collection(owner);144 owner: cross_from_sub; sender: cross_sub; burner: cross_sub;145 };146 let item = create_max_item(&collection, &owner, sender.clone())?;147 <Pallet<T>>::set_allowance(&collection, &sender, item, Some(&burner))?;148 }: {<Pallet<T>>::burn_from(&collection, &burner, &sender, item, &Unlimited)?}149150 set_token_property_permissions {151 let b in 0..MAX_PROPERTIES_PER_ITEM;152 bench_init!{153 owner: sub; collection: collection(owner);154 owner: cross_from_sub;155 };156 let perms = (0..b).map(|k| PropertyKeyPermission {157 key: property_key(k as usize),158 permission: PropertyPermission {159 mutable: false,160 collection_admin: false,161 token_owner: false,162 },163 }).collect::<Vec<_>>();164 }: {<Pallet<T>>::set_token_property_permissions(&collection, &owner, perms)?}165166 set_token_properties {167 let b in 0..MAX_PROPERTIES_PER_ITEM;168 bench_init!{169 owner: sub; collection: collection(owner);170 owner: cross_from_sub;171 };172 let perms = (0..b).map(|k| PropertyKeyPermission {173 key: property_key(k as usize),174 permission: PropertyPermission {175 mutable: false,176 collection_admin: true,177 token_owner: true,178 },179 }).collect::<Vec<_>>();180 <Pallet<T>>::set_token_property_permissions(&collection, &owner, perms)?;181 let props = (0..b).map(|k| Property {182 key: property_key(k as usize),183 value: property_value(),184 }).collect::<Vec<_>>();185 let item = create_max_item(&collection, &owner, owner.clone())?;186 }: {<Pallet<T>>::set_token_properties(&collection, &owner, item, props.into_iter(), false, &Unlimited)?}187188 delete_token_properties {189 let b in 0..MAX_PROPERTIES_PER_ITEM;190 bench_init!{191 owner: sub; collection: collection(owner);192 owner: cross_from_sub;193 };194 let perms = (0..b).map(|k| PropertyKeyPermission {195 key: property_key(k as usize),196 permission: PropertyPermission {197 mutable: true,198 collection_admin: true,199 token_owner: true,200 },201 }).collect::<Vec<_>>();202 <Pallet<T>>::set_token_property_permissions(&collection, &owner, perms)?;203 let props = (0..b).map(|k| Property {204 key: property_key(k as usize),205 value: property_value(),206 }).collect::<Vec<_>>();207 let item = create_max_item(&collection, &owner, owner.clone())?;208 <Pallet<T>>::set_token_properties(&collection, &owner, item, props.into_iter(), false, &Unlimited)?;209 let to_delete = (0..b).map(|k| property_key(k as usize)).collect::<Vec<_>>();210 }: {<Pallet<T>>::delete_token_properties(&collection, &owner, item, to_delete.into_iter(), &Unlimited)?}211}pallets/nonfungible/src/weights.rsdiffbeforeafterboth--- a/pallets/nonfungible/src/weights.rs
+++ b/pallets/nonfungible/src/weights.rs
@@ -3,7 +3,7 @@
//! Autogenerated weights for pallet_nonfungible
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
-//! DATE: 2022-06-15, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]`
+//! DATE: 2022-07-20, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024
// Executed Command:
@@ -56,7 +56,7 @@
// Storage: Nonfungible TokenData (r:0 w:1)
// Storage: Nonfungible Owned (r:0 w:1)
fn create_item() -> Weight {
- (24_135_000 as Weight)
+ (20_328_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
@@ -65,9 +65,9 @@
// Storage: Nonfungible TokenData (r:0 w:4)
// Storage: Nonfungible Owned (r:0 w:4)
fn create_multiple_items(b: u32, ) -> Weight {
- (21_952_000 as Weight)
- // Standard Error: 5_000
- .saturating_add((4_727_000 as Weight).saturating_mul(b as Weight))
+ (10_134_000 as Weight)
+ // Standard Error: 3_000
+ .saturating_add((4_927_000 as Weight).saturating_mul(b as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
.saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(b as Weight)))
@@ -77,9 +77,9 @@
// Storage: Nonfungible TokenData (r:0 w:4)
// Storage: Nonfungible Owned (r:0 w:4)
fn create_multiple_items_ex(b: u32, ) -> Weight {
- (10_432_000 as Weight)
- // Standard Error: 6_000
- .saturating_add((7_383_000 as Weight).saturating_mul(b as Weight))
+ (5_710_000 as Weight)
+ // Standard Error: 4_000
+ .saturating_add((7_578_000 as Weight).saturating_mul(b as Weight))
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight)))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
@@ -93,7 +93,7 @@
// Storage: Nonfungible Owned (r:0 w:1)
// Storage: Nonfungible TokenProperties (r:0 w:1)
fn burn_item() -> Weight {
- (29_798_000 as Weight)
+ (28_433_000 as Weight)
.saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().writes(5 as Weight))
}
@@ -105,7 +105,7 @@
// Storage: Nonfungible Owned (r:0 w:1)
// Storage: Nonfungible TokenProperties (r:0 w:1)
fn burn_recursively_self_raw() -> Weight {
- (37_955_000 as Weight)
+ (34_435_000 as Weight)
.saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().writes(5 as Weight))
}
@@ -119,8 +119,8 @@
// Storage: Common CollectionById (r:1 w:0)
fn burn_recursively_breadth_plus_self_plus_self_per_each_raw(b: u32, ) -> Weight {
(0 as Weight)
- // Standard Error: 1_349_000
- .saturating_add((275_145_000 as Weight).saturating_mul(b as Weight))
+ // Standard Error: 1_539_000
+ .saturating_add((304_456_000 as Weight).saturating_mul(b as Weight))
.saturating_add(T::DbWeight::get().reads(7 as Weight))
.saturating_add(T::DbWeight::get().reads((4 as Weight).saturating_mul(b as Weight)))
.saturating_add(T::DbWeight::get().writes(6 as Weight))
@@ -131,14 +131,14 @@
// Storage: Nonfungible Allowance (r:1 w:0)
// Storage: Nonfungible Owned (r:0 w:2)
fn transfer() -> Weight {
- (27_867_000 as Weight)
+ (24_376_000 as Weight)
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(5 as Weight))
}
// Storage: Nonfungible TokenData (r:1 w:0)
// Storage: Nonfungible Allowance (r:1 w:1)
fn approve() -> Weight {
- (18_824_000 as Weight)
+ (15_890_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
@@ -147,7 +147,7 @@
// Storage: Nonfungible AccountBalance (r:2 w:2)
// Storage: Nonfungible Owned (r:0 w:2)
fn transfer_from() -> Weight {
- (32_879_000 as Weight)
+ (28_634_000 as Weight)
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(6 as Weight))
}
@@ -159,7 +159,7 @@
// Storage: Nonfungible Owned (r:0 w:1)
// Storage: Nonfungible TokenProperties (r:0 w:1)
fn burn_from() -> Weight {
- (37_061_000 as Weight)
+ (32_201_000 as Weight)
.saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().writes(6 as Weight))
}
@@ -167,28 +167,26 @@
fn set_token_property_permissions(b: u32, ) -> Weight {
(0 as Weight)
// Standard Error: 57_000
- .saturating_add((15_149_000 as Weight).saturating_mul(b as Weight))
+ .saturating_add((15_232_000 as Weight).saturating_mul(b as Weight))
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Common CollectionPropertyPermissions (r:1 w:0)
- // Storage: Nonfungible TokenData (r:1 w:0)
// Storage: Nonfungible TokenProperties (r:1 w:1)
fn set_token_properties(b: u32, ) -> Weight {
(0 as Weight)
- // Standard Error: 2_278_000
- .saturating_add((409_613_000 as Weight).saturating_mul(b as Weight))
- .saturating_add(T::DbWeight::get().reads(3 as Weight))
+ // Standard Error: 1_648_000
+ .saturating_add((288_654_000 as Weight).saturating_mul(b as Weight))
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Common CollectionPropertyPermissions (r:1 w:0)
- // Storage: Nonfungible TokenData (r:1 w:0)
// Storage: Nonfungible TokenProperties (r:1 w:1)
fn delete_token_properties(b: u32, ) -> Weight {
(0 as Weight)
- // Standard Error: 2_234_000
- .saturating_add((408_185_000 as Weight).saturating_mul(b as Weight))
- .saturating_add(T::DbWeight::get().reads(3 as Weight))
+ // Standard Error: 1_632_000
+ .saturating_add((289_190_000 as Weight).saturating_mul(b as Weight))
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
}
@@ -200,7 +198,7 @@
// Storage: Nonfungible TokenData (r:0 w:1)
// Storage: Nonfungible Owned (r:0 w:1)
fn create_item() -> Weight {
- (24_135_000 as Weight)
+ (20_328_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(4 as Weight))
}
@@ -209,9 +207,9 @@
// Storage: Nonfungible TokenData (r:0 w:4)
// Storage: Nonfungible Owned (r:0 w:4)
fn create_multiple_items(b: u32, ) -> Weight {
- (21_952_000 as Weight)
- // Standard Error: 5_000
- .saturating_add((4_727_000 as Weight).saturating_mul(b as Weight))
+ (10_134_000 as Weight)
+ // Standard Error: 3_000
+ .saturating_add((4_927_000 as Weight).saturating_mul(b as Weight))
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
.saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(b as Weight)))
@@ -221,9 +219,9 @@
// Storage: Nonfungible TokenData (r:0 w:4)
// Storage: Nonfungible Owned (r:0 w:4)
fn create_multiple_items_ex(b: u32, ) -> Weight {
- (10_432_000 as Weight)
- // Standard Error: 6_000
- .saturating_add((7_383_000 as Weight).saturating_mul(b as Weight))
+ (5_710_000 as Weight)
+ // Standard Error: 4_000
+ .saturating_add((7_578_000 as Weight).saturating_mul(b as Weight))
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
.saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(b as Weight)))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
@@ -237,7 +235,7 @@
// Storage: Nonfungible Owned (r:0 w:1)
// Storage: Nonfungible TokenProperties (r:0 w:1)
fn burn_item() -> Weight {
- (29_798_000 as Weight)
+ (28_433_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(5 as Weight))
.saturating_add(RocksDbWeight::get().writes(5 as Weight))
}
@@ -249,7 +247,7 @@
// Storage: Nonfungible Owned (r:0 w:1)
// Storage: Nonfungible TokenProperties (r:0 w:1)
fn burn_recursively_self_raw() -> Weight {
- (37_955_000 as Weight)
+ (34_435_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(5 as Weight))
.saturating_add(RocksDbWeight::get().writes(5 as Weight))
}
@@ -263,8 +261,8 @@
// Storage: Common CollectionById (r:1 w:0)
fn burn_recursively_breadth_plus_self_plus_self_per_each_raw(b: u32, ) -> Weight {
(0 as Weight)
- // Standard Error: 1_349_000
- .saturating_add((275_145_000 as Weight).saturating_mul(b as Weight))
+ // Standard Error: 1_539_000
+ .saturating_add((304_456_000 as Weight).saturating_mul(b as Weight))
.saturating_add(RocksDbWeight::get().reads(7 as Weight))
.saturating_add(RocksDbWeight::get().reads((4 as Weight).saturating_mul(b as Weight)))
.saturating_add(RocksDbWeight::get().writes(6 as Weight))
@@ -275,14 +273,14 @@
// Storage: Nonfungible Allowance (r:1 w:0)
// Storage: Nonfungible Owned (r:0 w:2)
fn transfer() -> Weight {
- (27_867_000 as Weight)
+ (24_376_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(4 as Weight))
.saturating_add(RocksDbWeight::get().writes(5 as Weight))
}
// Storage: Nonfungible TokenData (r:1 w:0)
// Storage: Nonfungible Allowance (r:1 w:1)
fn approve() -> Weight {
- (18_824_000 as Weight)
+ (15_890_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
@@ -291,7 +289,7 @@
// Storage: Nonfungible AccountBalance (r:2 w:2)
// Storage: Nonfungible Owned (r:0 w:2)
fn transfer_from() -> Weight {
- (32_879_000 as Weight)
+ (28_634_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(4 as Weight))
.saturating_add(RocksDbWeight::get().writes(6 as Weight))
}
@@ -303,7 +301,7 @@
// Storage: Nonfungible Owned (r:0 w:1)
// Storage: Nonfungible TokenProperties (r:0 w:1)
fn burn_from() -> Weight {
- (37_061_000 as Weight)
+ (32_201_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(5 as Weight))
.saturating_add(RocksDbWeight::get().writes(6 as Weight))
}
@@ -311,28 +309,26 @@
fn set_token_property_permissions(b: u32, ) -> Weight {
(0 as Weight)
// Standard Error: 57_000
- .saturating_add((15_149_000 as Weight).saturating_mul(b as Weight))
+ .saturating_add((15_232_000 as Weight).saturating_mul(b as Weight))
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
// Storage: Common CollectionPropertyPermissions (r:1 w:0)
- // Storage: Nonfungible TokenData (r:1 w:0)
// Storage: Nonfungible TokenProperties (r:1 w:1)
fn set_token_properties(b: u32, ) -> Weight {
(0 as Weight)
- // Standard Error: 2_278_000
- .saturating_add((409_613_000 as Weight).saturating_mul(b as Weight))
- .saturating_add(RocksDbWeight::get().reads(3 as Weight))
+ // Standard Error: 1_648_000
+ .saturating_add((288_654_000 as Weight).saturating_mul(b as Weight))
+ .saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
// Storage: Common CollectionPropertyPermissions (r:1 w:0)
- // Storage: Nonfungible TokenData (r:1 w:0)
// Storage: Nonfungible TokenProperties (r:1 w:1)
fn delete_token_properties(b: u32, ) -> Weight {
(0 as Weight)
- // Standard Error: 2_234_000
- .saturating_add((408_185_000 as Weight).saturating_mul(b as Weight))
- .saturating_add(RocksDbWeight::get().reads(3 as Weight))
+ // Standard Error: 1_632_000
+ .saturating_add((289_190_000 as Weight).saturating_mul(b as Weight))
+ .saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
}
pallets/refungible/src/benchmarking.rsdiffbeforeafterboth--- a/pallets/refungible/src/benchmarking.rs
+++ b/pallets/refungible/src/benchmarking.rs
@@ -38,6 +38,7 @@
.collect::<BTreeMap<_, _>>()
.try_into()
.unwrap(),
+ properties: Default::default(),
}
}
fn create_max_item<T: Config>(