difftreelog
feat rmrk-core benchmarking
in: master
11 files changed
Makefilediffbeforeafterboth93bench-structure:93bench-structure:94 make _bench PALLET=structure94 make _bench PALLET=structure9596.PHONY: bench-rmrk-core97bench-rmrk-core:98 make _bench PALLET=proxy-rmrk-core959996.PHONY: bench100.PHONY: bench97bench: bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible101bench: bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungiblepallets/common/src/benchmarking.rsdiffbeforeafterboth109 create_collection_raw(109 create_collection_raw(110 owner,110 owner,111 CollectionMode::NFT,111 CollectionMode::NFT,112 |owner, data| <Pallet<T>>::init_collection(owner, data),112 |owner, data| <Pallet<T>>::init_collection(owner, data, true),113 |h| h,113 |h| h,114 )114 )115}115}pallets/common/src/lib.rsdiffbeforeafterboth427 /// Target collection doesn't supports this operation427 /// Target collection doesn't supports this operation428 UnsupportedOperation,428 UnsupportedOperation,429429430 /// Not sufficient founds to perform action430 /// Not sufficient funds to perform action431 NotSufficientFounds,431 NotSufficientFounds,432432433 /// Collection has nesting disabled433 /// Collection has nesting disabledpallets/nonfungible/src/benchmarking.rsdiffbeforeafterboth51 create_collection_raw(51 create_collection_raw(52 owner,52 owner,53 CollectionMode::NFT,53 CollectionMode::NFT,54 <Pallet<T>>::init_collection,54 |owner, data| <Pallet<T>>::init_collection(owner, data, true),55 NonfungibleHandle::cast,55 NonfungibleHandle::cast,56 )56 )57}57}99 sender: cross_from_sub(owner); burner: cross_sub;99 sender: cross_from_sub(owner); burner: cross_sub;100 };100 };101 let item = create_max_item(&collection, &sender, burner.clone())?;101 let item = create_max_item(&collection, &sender, burner.clone())?;102 }: {<Pallet<T>>::burn_recursively(&collection, &burner, item, &Unlimited, &Unlimited)}102 }: {<Pallet<T>>::burn_recursively(&collection, &burner, item, &Unlimited, &Unlimited)?}103103104 burn_recursively_breadth_plus_self_plus_self_per_each_raw {104 burn_recursively_breadth_plus_self_plus_self_per_each_raw {105 let b in 0..200;105 let b in 0..200;111 for i in 0..b {111 for i in 0..b {112 create_max_item(&collection, &sender, T::CrossTokenAddressMapping::token_to_address(collection.id, item))?;112 create_max_item(&collection, &sender, T::CrossTokenAddressMapping::token_to_address(collection.id, item))?;113 }113 }114 }: {<Pallet<T>>::burn_recursively(&collection, &burner, item, &Unlimited, &Unlimited)}114 }: {<Pallet<T>>::burn_recursively(&collection, &burner, item, &Unlimited, &Unlimited)?}115115116 transfer {116 transfer {117 bench_init!{117 bench_init!{183 value: property_value(),183 value: property_value(),184 }).collect::<Vec<_>>();184 }).collect::<Vec<_>>();185 let item = create_max_item(&collection, &owner, owner.clone())?;185 let item = create_max_item(&collection, &owner, owner.clone())?;186 }: {<Pallet<T>>::set_token_properties(&collection, &owner, item, props)?}186 }: {<Pallet<T>>::set_token_properties(&collection, &owner, item, props, false)?}187187188 delete_token_properties {188 delete_token_properties {189 let b in 0..MAX_PROPERTIES_PER_ITEM;189 let b in 0..MAX_PROPERTIES_PER_ITEM;205 value: property_value(),205 value: property_value(),206 }).collect::<Vec<_>>();206 }).collect::<Vec<_>>();207 let item = create_max_item(&collection, &owner, owner.clone())?;207 let item = create_max_item(&collection, &owner, owner.clone())?;208 <Pallet<T>>::set_token_properties(&collection, &owner, item, props)?;208 <Pallet<T>>::set_token_properties(&collection, &owner, item, props, false)?;209 let to_delete = (0..b).map(|k| property_key(k as usize)).collect::<Vec<_>>();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)?}210 }: {<Pallet<T>>::delete_token_properties(&collection, &owner, item, to_delete)?}211}211}pallets/proxy-rmrk-core/src/benchmarking.rsdiffbeforeafterbothno changes
pallets/proxy-rmrk-core/src/lib.rsdiffbeforeafterboth313132pub use pallet::*;32pub use pallet::*;333334#[cfg(feature = "runtime-benchmarks")]35pub mod benchmarking;34pub mod misc;36pub mod misc;35pub mod property;37pub mod property;3638pub mod weights;3940pub type SelfWeightOf<T> = <T as Config>::WeightInfo;4142use weights::WeightInfo;37use misc::*;43use misc::*;38pub use property::*;44pub use property::*;394551 frame_system::Config + pallet_common::Config + pallet_nonfungible::Config + account::Config57 frame_system::Config + pallet_common::Config + pallet_nonfungible::Config + account::Config52 {58 {53 type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::Event>;59 type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::Event>;60 type WeightInfo: WeightInfo;54 }61 }556256 #[pallet::storage]63 #[pallet::storage]169176170 #[pallet::call]177 #[pallet::call]171 impl<T: Config> Pallet<T> {178 impl<T: Config> Pallet<T> {172 #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]179 #[pallet::weight(<SelfWeightOf<T>>::create_collection())]173 #[transactional]180 #[transactional]174 pub fn create_collection(181 pub fn create_collection(175 origin: OriginFor<T>,182 origin: OriginFor<T>,pallets/proxy-rmrk-core/src/weights.rsdiffbeforeafterbothno changes
runtime/common/src/runtime_apis.rsdiffbeforeafterboth827 list_benchmark!(list, extra, pallet_fungible, Fungible);827 list_benchmark!(list, extra, pallet_fungible, Fungible);828 list_benchmark!(list, extra, pallet_refungible, Refungible);828 list_benchmark!(list, extra, pallet_refungible, Refungible);829 list_benchmark!(list, extra, pallet_nonfungible, Nonfungible);829 list_benchmark!(list, extra, pallet_nonfungible, Nonfungible);830 list_benchmark!(list, extra, pallet_proxy_rmrk_core, RmrkCore);830 // list_benchmark!(list, extra, pallet_evm_coder_substrate, EvmCoderSubstrate);831 // list_benchmark!(list, extra, pallet_evm_coder_substrate, EvmCoderSubstrate);831832832 let storage_info = AllPalletsReversedWithSystemFirst::storage_info();833 let storage_info = AllPalletsReversedWithSystemFirst::storage_info();870 add_benchmark!(params, batches, pallet_fungible, Fungible);871 add_benchmark!(params, batches, pallet_fungible, Fungible);871 add_benchmark!(params, batches, pallet_refungible, Refungible);872 add_benchmark!(params, batches, pallet_refungible, Refungible);872 add_benchmark!(params, batches, pallet_nonfungible, Nonfungible);873 add_benchmark!(params, batches, pallet_nonfungible, Nonfungible);874 add_benchmark!(params, batches, pallet_proxy_rmrk_core, RmrkCore);873 // add_benchmark!(params, batches, pallet_evm_coder_substrate, EvmCoderSubstrate);875 // add_benchmark!(params, batches, pallet_evm_coder_substrate, EvmCoderSubstrate);874876875 if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }877 if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }runtime/opal/src/lib.rsdiffbeforeafterboth919}919}920920921impl pallet_proxy_rmrk_core::Config for Runtime {921impl pallet_proxy_rmrk_core::Config for Runtime {922 type WeightInfo = pallet_proxy_rmrk_core::weights::SubstrateWeight<Self>;922 type Event = Event;923 type Event = Event;923}924}924925runtime/quartz/src/lib.rsdiffbeforeafterboth918}918}919919920impl pallet_proxy_rmrk_core::Config for Runtime {920impl pallet_proxy_rmrk_core::Config for Runtime {921 type WeightInfo = pallet_proxy_rmrk_core::weights::SubstrateWeight<Self>;921 type Event = Event;922 type Event = Event;922}923}923924runtime/unique/src/lib.rsdiffbeforeafterboth917}917}918918919impl pallet_proxy_rmrk_core::Config for Runtime {919impl pallet_proxy_rmrk_core::Config for Runtime {920 type WeightInfo = pallet_proxy_rmrk_core::weights::SubstrateWeight<Self>;920 type Event = Event;921 type Event = Event;921}922}922923