difftreelog
feat bench bulk mints
in: master
2 files changed
pallets/nft/src/benchmarking.rsdiffbeforeafterboth162 });162 });163 }: create_item(RawOrigin::Signed(caller.clone()), collection, T::CrossAccountId::from_sub(caller.clone()), data)163 }: create_item(RawOrigin::Signed(caller.clone()), collection, T::CrossAccountId::from_sub(caller.clone()), data)164165 create_multiple_items_nft {166 // TODO: Take item data size into account. As create_item_nft bench shows, this parameter has no effect on execution time,167 // but it may if we increase CUSTOM_DATA_LIMIT168 let b in 1..1000;169170 let caller: T::AccountId = account("caller", 0, SEED);171 let collection = create_nft_collection::<T>(caller.clone())?;172 let data = (0..b).map(|_| default_nft_data()).collect();173 }: create_multiple_items(RawOrigin::Signed(caller.clone()), collection, T::CrossAccountId::from_sub(caller.clone()), data)164174165 // fungible item175 // fungible item166 create_item_fungible {176 create_item_fungible {171 });181 });172 }: create_item(RawOrigin::Signed(caller.clone()), collection, T::CrossAccountId::from_sub(caller.clone()), data)182 }: create_item(RawOrigin::Signed(caller.clone()), collection, T::CrossAccountId::from_sub(caller.clone()), data)183184 create_multiple_items_fungible {185 let b in 1..1000;186187 let caller: T::AccountId = account("caller", 0, SEED);188 let collection = create_fungible_collection::<T>(caller.clone())?;189 let data = (0..b).map(|_| default_fungible_data()).collect();190 }: create_multiple_items(RawOrigin::Signed(caller.clone()), collection, T::CrossAccountId::from_sub(caller.clone()), data)173191174 // refungible item192 // refungible item175 create_item_refungible {193 create_item_refungible {184 });202 });185 }: create_item(RawOrigin::Signed(caller.clone()), collection, T::CrossAccountId::from_sub(caller.clone()), data)203 }: create_item(RawOrigin::Signed(caller.clone()), collection, T::CrossAccountId::from_sub(caller.clone()), data)204205 create_multiple_items_refungible {206 // TODO: Take item data size into account. As create_item_nft bench shows, this parameter has no effect on execution time,207 // but it may if we increase CUSTOM_DATA_LIMIT208 let b in 1..1000;209210 let caller: T::AccountId = account("caller", 0, SEED);211 let collection = create_refungible_collection::<T>(caller.clone())?;212 let data = (0..b).map(|_| default_re_fungible_data()).collect();213 }: create_multiple_items(RawOrigin::Signed(caller.clone()), collection, T::CrossAccountId::from_sub(caller.clone()), data)186214187 burn_item_nft {215 burn_item_nft {188 let caller: T::AccountId = account("caller", 0, SEED);216 let caller: T::AccountId = account("caller", 0, SEED);215 <Pallet<T>>::create_item(RawOrigin::Signed(caller.clone()).into(), collection, T::CrossAccountId::from_sub(caller.clone()), data)?;243 <Pallet<T>>::create_item(RawOrigin::Signed(caller.clone()).into(), collection, T::CrossAccountId::from_sub(caller.clone()), data)?;216 }: transfer(RawOrigin::Signed(caller.clone()), T::CrossAccountId::from_sub(recipient.clone()), collection, 1, 1)244 }: transfer(RawOrigin::Signed(caller.clone()), T::CrossAccountId::from_sub(recipient.clone()), collection, 1, 1)245246 set_transfers_enabled_flag {247 let caller: T::AccountId = account("caller", 0, SEED);248 let collection = create_nft_collection::<T>(caller.clone())?;249 }: _(RawOrigin::Signed(caller.clone()), collection, false)217250218 approve_nft {251 approve_nft {219 let caller: T::AccountId = account("caller", 0, SEED);252 let caller: T::AccountId = account("caller", 0, SEED);pallets/nft/src/weights.rsdiffbeforeafterboth3//! Autogenerated weights for pallet_nft3//! Autogenerated weights for pallet_nft4//!4//!5//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.05//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.06//! DATE: 2021-08-30, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`6//! DATE: 2021-08-31, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`7//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1287//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 128889// Executed Command:9// Executed Command:44 fn confirm_sponsorship() -> Weight;44 fn confirm_sponsorship() -> Weight;45 fn remove_collection_sponsor() -> Weight;45 fn remove_collection_sponsor() -> Weight;46 fn create_item_nft(b: u32, ) -> Weight;46 fn create_item_nft(b: u32, ) -> Weight;47 fn create_multiple_items_nft(b: u32, ) -> Weight;47 fn create_item_fungible() -> Weight;48 fn create_item_fungible() -> Weight;49 fn create_multiple_items_fungible(b: u32, ) -> Weight;48 fn create_item_refungible(b: u32, ) -> Weight;50 fn create_item_refungible(b: u32, ) -> Weight;51 fn create_multiple_items_refungible(b: u32, ) -> Weight;49 fn burn_item_nft() -> Weight;52 fn burn_item_nft() -> Weight;50 fn transfer_nft() -> Weight;53 fn transfer_nft() -> Weight;51 fn transfer_fungible() -> Weight;54 fn transfer_fungible() -> Weight;52 fn transfer_refungible() -> Weight;55 fn transfer_refungible() -> Weight;56 fn set_transfers_enabled_flag() -> Weight;53 fn approve_nft() -> Weight;57 fn approve_nft() -> Weight;54 fn transfer_from_nft() -> Weight;58 fn transfer_from_nft() -> Weight;55 fn transfer_from_fungible() -> Weight;59 fn transfer_from_fungible() -> Weight;130 .saturating_add(T::DbWeight::get().reads(11 as Weight))134 .saturating_add(T::DbWeight::get().reads(11 as Weight))131 .saturating_add(T::DbWeight::get().writes(8 as Weight))135 .saturating_add(T::DbWeight::get().writes(8 as Weight))132 }136 }137 fn create_multiple_items_nft(b: u32, ) -> Weight {138 (336_830_000 as Weight)139 // Standard Error: 42_000140 .saturating_add((11_627_000 as Weight).saturating_mul(b as Weight))141 .saturating_add(T::DbWeight::get().reads(11 as Weight))142 .saturating_add(T::DbWeight::get().writes(7 as Weight))143 .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(b as Weight)))144 }133 fn create_item_fungible() -> Weight {145 fn create_item_fungible() -> Weight {134 (22_331_000 as Weight)146 (24_123_000 as Weight)135 .saturating_add(T::DbWeight::get().reads(9 as Weight))147 .saturating_add(T::DbWeight::get().reads(9 as Weight))136 .saturating_add(T::DbWeight::get().writes(4 as Weight))148 .saturating_add(T::DbWeight::get().writes(4 as Weight))137 }149 }150 fn create_multiple_items_fungible(b: u32, ) -> Weight {151 (48_227_000 as Weight)152 // Standard Error: 13_000153 .saturating_add((2_918_000 as Weight).saturating_mul(b as Weight))154 .saturating_add(T::DbWeight::get().reads(9 as Weight))155 .saturating_add(T::DbWeight::get().writes(4 as Weight))156 }138 fn create_item_refungible(_b: u32, ) -> Weight {157 fn create_item_refungible(_b: u32, ) -> Weight {139 (26_293_000 as Weight)158 (26_293_000 as Weight)140 .saturating_add(T::DbWeight::get().reads(9 as Weight))159 .saturating_add(T::DbWeight::get().reads(9 as Weight))141 .saturating_add(T::DbWeight::get().writes(7 as Weight))160 .saturating_add(T::DbWeight::get().writes(7 as Weight))142 }161 }162 fn create_multiple_items_refungible(b: u32, ) -> Weight {163 (0 as Weight)164 // Standard Error: 16_000165 .saturating_add((8_374_000 as Weight).saturating_mul(b as Weight))166 .saturating_add(T::DbWeight::get().reads(9 as Weight))167 .saturating_add(T::DbWeight::get().writes(6 as Weight))168 .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(b as Weight)))169 }143 fn burn_item_nft() -> Weight {170 fn burn_item_nft() -> Weight {144 (32_237_000 as Weight)171 (32_237_000 as Weight)145 .saturating_add(T::DbWeight::get().reads(9 as Weight))172 .saturating_add(T::DbWeight::get().reads(9 as Weight))160 .saturating_add(T::DbWeight::get().reads(10 as Weight))187 .saturating_add(T::DbWeight::get().reads(10 as Weight))161 .saturating_add(T::DbWeight::get().writes(7 as Weight))188 .saturating_add(T::DbWeight::get().writes(7 as Weight))162 }189 }190 fn set_transfers_enabled_flag() -> Weight {191 (6_376_000 as Weight)192 .saturating_add(T::DbWeight::get().reads(1 as Weight))193 .saturating_add(T::DbWeight::get().writes(1 as Weight))194 }163 fn approve_nft() -> Weight {195 fn approve_nft() -> Weight {164 (169_825_000 as Weight)196 (169_825_000 as Weight)165 .saturating_add(T::DbWeight::get().reads(9 as Weight))197 .saturating_add(T::DbWeight::get().reads(9 as Weight))274 .saturating_add(RocksDbWeight::get().reads(1 as Weight))306 .saturating_add(RocksDbWeight::get().reads(1 as Weight))275 .saturating_add(RocksDbWeight::get().writes(1 as Weight))307 .saturating_add(RocksDbWeight::get().writes(1 as Weight))276 }308 }277 fn create_item_nft(_b: u32, ) -> Weight {309 fn create_item_nft(b: u32, ) -> Weight {278 (167_909_000 as Weight)310 (167_180_000 as Weight)311 // Standard Error: 1_000312 .saturating_add((10_000 as Weight).saturating_mul(b as Weight))279 .saturating_add(RocksDbWeight::get().reads(11 as Weight))313 .saturating_add(RocksDbWeight::get().reads(11 as Weight))280 .saturating_add(RocksDbWeight::get().writes(8 as Weight))314 .saturating_add(RocksDbWeight::get().writes(8 as Weight))281 }315 }316 fn create_multiple_items_nft(b: u32, ) -> Weight {317 (336_830_000 as Weight)318 // Standard Error: 42_000319 .saturating_add((11_627_000 as Weight).saturating_mul(b as Weight))320 .saturating_add(RocksDbWeight::get().reads(11 as Weight))321 .saturating_add(RocksDbWeight::get().writes(7 as Weight))322 .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(b as Weight)))323 }282 fn create_item_fungible() -> Weight {324 fn create_item_fungible() -> Weight {283 (22_331_000 as Weight)325 (24_123_000 as Weight)284 .saturating_add(RocksDbWeight::get().reads(9 as Weight))326 .saturating_add(RocksDbWeight::get().reads(9 as Weight))285 .saturating_add(RocksDbWeight::get().writes(4 as Weight))327 .saturating_add(RocksDbWeight::get().writes(4 as Weight))286 }328 }329 fn create_multiple_items_fungible(b: u32, ) -> Weight {330 (13_217_000 as Weight)331 // Standard Error: 4_000332 .saturating_add((2_971_000 as Weight).saturating_mul(b as Weight))333 .saturating_add(RocksDbWeight::get().reads(9 as Weight))334 .saturating_add(RocksDbWeight::get().writes(4 as Weight))335 }287 fn create_item_refungible(_b: u32, ) -> Weight {336 fn create_item_refungible(_b: u32, ) -> Weight {288 (26_293_000 as Weight)337 (26_293_000 as Weight)289 .saturating_add(RocksDbWeight::get().reads(9 as Weight))338 .saturating_add(RocksDbWeight::get().reads(9 as Weight))290 .saturating_add(RocksDbWeight::get().writes(7 as Weight))339 .saturating_add(RocksDbWeight::get().writes(7 as Weight))291 }340 }341 fn create_multiple_items_refungible(b: u32, ) -> Weight {342 (0 as Weight)343 // Standard Error: 16_000344 .saturating_add((8_374_000 as Weight).saturating_mul(b as Weight))345 .saturating_add(RocksDbWeight::get().reads(9 as Weight))346 .saturating_add(RocksDbWeight::get().writes(6 as Weight))347 .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(b as Weight)))348 }292 fn burn_item_nft() -> Weight {349 fn burn_item_nft() -> Weight {293 (32_237_000 as Weight)350 (32_237_000 as Weight)294 .saturating_add(RocksDbWeight::get().reads(9 as Weight))351 .saturating_add(RocksDbWeight::get().reads(9 as Weight))309 .saturating_add(RocksDbWeight::get().reads(10 as Weight))366 .saturating_add(RocksDbWeight::get().reads(10 as Weight))310 .saturating_add(RocksDbWeight::get().writes(7 as Weight))367 .saturating_add(RocksDbWeight::get().writes(7 as Weight))311 }368 }369 fn set_transfers_enabled_flag() -> Weight {370 (6_376_000 as Weight)371 .saturating_add(RocksDbWeight::get().reads(1 as Weight))372 .saturating_add(RocksDbWeight::get().writes(1 as Weight))373 }312 fn approve_nft() -> Weight {374 fn approve_nft() -> Weight {313 (169_825_000 as Weight)375 (169_825_000 as Weight)314 .saturating_add(RocksDbWeight::get().reads(9 as Weight))376 .saturating_add(RocksDbWeight::get().reads(9 as Weight))