This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
XCM Benchmarks for Generic Instructions (#3940)
* initial stuff * quick fixes * move to individual tests * dont need these * Update benchmarking.rs * add to westend * make benchmarks execute * fix compile * add post_execute * ClaimAsset benchmark working * subscribe and unsubscribe benchmarks * benchmark for initiate reserve withdraw * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=pallet_xcm_benchmarks::generic --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --template=./xcm/pallet-xcm-benchmarks/template.hbs --output=./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs * fix spell check * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=pallet_xcm_benchmarks::generic --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --template=./xcm/pallet-xcm-benchmarks/template.hbs --output=./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs * update worst case for query_holding * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=pallet_xcm_benchmarks::generic --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --template=./xcm/pallet-xcm-benchmarks/template.hbs --output=./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs * move verification logic below * introduce worst case holding to initiate reserve withdraw * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=pallet_xcm_benchmarks::generic --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --template=./xcm/pallet-xcm-benchmarks/template.hbs --output=./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs * feedback * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=pallet_xcm_benchmarks::generic --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --template=./xcm/pallet-xcm-benchmarks/template.hbs --output=./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs * Revert "cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=pallet_xcm_benchmarks::generic --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --template=./xcm/pallet-xcm-benchmarks/template.hbs --output=./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs" This reverts commit 2779039. * fix benchmark template * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=pallet_xcm_benchmarks::generic --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --template=./xcm/pallet-xcm-benchmarks/template.hbs --output=./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs * use response::version * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=pallet_xcm_benchmarks::generic --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --template=./xcm/pallet-xcm-benchmarks/template.hbs --output=./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs * refactor worst case holding * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=pallet_xcm_benchmarks::generic --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --template=./xcm/pallet-xcm-benchmarks/template.hbs --output=./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs * fmt * one more todo needs to be labeled * change option to result with benchmark error * fmt and fix import Co-authored-by: Parity Bot <admin@parity.io>
- Loading branch information
1 parent
70ec451
commit 59aa955
Showing
14 changed files
with
747 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
185 changes: 122 additions & 63 deletions
185
runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,132 @@ | ||
// this whole file is temp, and will be replaced in the future TODO | ||
// Copyright 2017-2021 Parity Technologies (UK) Ltd. | ||
// This file is part of Polkadot. | ||
|
||
use frame_support::dispatch::Weight; | ||
// Polkadot is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
|
||
pub struct WeightInfo<T>(sp_std::marker::PhantomData<T>); | ||
impl<T: frame_system::Config> WeightInfo<T> { | ||
pub fn query_holding() -> Weight { | ||
1_000_000_000 | ||
} | ||
pub fn buy_execution() -> Weight { | ||
1_000_000_000 | ||
} | ||
pub fn transact() -> Weight { | ||
1_000_000_000 | ||
} | ||
pub fn reserve_asset_deposited() -> Weight { | ||
1_000_000_000 | ||
} | ||
pub fn hrmp_new_channel_open_request() -> Weight { | ||
1_000_000_000 | ||
} | ||
pub fn hrmp_channel_accepted() -> Weight { | ||
1_000_000_000 | ||
} | ||
pub fn hrmp_channel_closing() -> Weight { | ||
1_000_000_000 | ||
} | ||
pub fn relayed_from() -> Weight { | ||
1_000_000_000 | ||
} | ||
pub fn refund_surplus() -> Weight { | ||
1_000_000_000 | ||
} | ||
pub fn set_error_handler() -> Weight { | ||
1_000_000_000 | ||
} | ||
pub fn set_appendix() -> Weight { | ||
1_000_000_000 | ||
} | ||
pub fn clear_error() -> Weight { | ||
1_000_000_000 | ||
} | ||
pub fn claim_asset(_assets: &crate::MultiAssets) -> Weight { | ||
1_000_000_000 | ||
} | ||
pub fn trap(_code: &u64) -> Weight { | ||
1_000_000_000 | ||
} | ||
// Polkadot is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
pub fn subscribe_version() -> Weight { | ||
1_000_000_000 | ||
} | ||
// You should have received a copy of the GNU General Public License | ||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
pub fn unsubscribe_version() -> Weight { | ||
1_000_000_000 | ||
} | ||
//! Autogenerated weights for `pallet_xcm_benchmarks::generic` | ||
//! | ||
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev | ||
//! DATE: 2021-12-01, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` | ||
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westend-dev"), DB CACHE: 128 | ||
|
||
pub fn clear_origin() -> Weight { | ||
1_000_000_000 | ||
} | ||
// Executed Command: | ||
// target/release/polkadot | ||
// benchmark | ||
// --chain=westend-dev | ||
// --steps=50 | ||
// --repeat=20 | ||
// --pallet=pallet_xcm_benchmarks::generic | ||
// --extrinsic=* | ||
// --execution=wasm | ||
// --wasm-execution=compiled | ||
// --heap-pages=4096 | ||
// --header=./file_header.txt | ||
// --template=./xcm/pallet-xcm-benchmarks/template.hbs | ||
// --output=./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs | ||
|
||
pub fn descend_origin(_who: &crate::InteriorMultiLocation) -> Weight { | ||
1_000_000_000 | ||
} | ||
#![cfg_attr(rustfmt, rustfmt_skip)] | ||
#![allow(unused_parens)] | ||
#![allow(unused_imports)] | ||
|
||
pub fn initiate_reserve_withdraw() -> Weight { | ||
1_000_000_000 | ||
} | ||
use frame_support::{traits::Get, weights::Weight}; | ||
use sp_std::marker::PhantomData; | ||
|
||
pub fn report_error() -> Weight { | ||
1_000_000_000 | ||
/// Weights for `pallet_xcm_benchmarks::generic`. | ||
pub struct WeightInfo<T>(PhantomData<T>); | ||
impl<T: frame_system::Config> WeightInfo<T> { | ||
// Storage: XcmPallet SupportedVersion (r:1 w:0) | ||
// Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1) | ||
// Storage: XcmPallet SafeXcmVersion (r:1 w:0) | ||
// Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) | ||
// Storage: Dmp DownwardMessageQueues (r:1 w:1) | ||
pub(crate) fn query_holding() -> Weight { | ||
(39_278_000 as Weight) | ||
.saturating_add(T::DbWeight::get().reads(5 as Weight)) | ||
.saturating_add(T::DbWeight::get().writes(3 as Weight)) | ||
} | ||
pub(crate) fn buy_execution() -> Weight { | ||
(5_922_000 as Weight) | ||
} | ||
// Storage: XcmPallet Queries (r:1 w:0) | ||
pub(crate) fn query_response() -> Weight { | ||
(20_625_000 as Weight) | ||
.saturating_add(T::DbWeight::get().reads(1 as Weight)) | ||
} | ||
pub(crate) fn transact() -> Weight { | ||
(22_198_000 as Weight) | ||
} | ||
pub(crate) fn refund_surplus() -> Weight { | ||
(6_122_000 as Weight) | ||
} | ||
pub(crate) fn set_error_handler() -> Weight { | ||
(5_758_000 as Weight) | ||
} | ||
pub(crate) fn set_appendix() -> Weight { | ||
(5_764_000 as Weight) | ||
} | ||
pub(crate) fn clear_error() -> Weight { | ||
(5_679_000 as Weight) | ||
} | ||
pub(crate) fn descend_origin() -> Weight { | ||
(7_206_000 as Weight) | ||
} | ||
pub(crate) fn clear_origin() -> Weight { | ||
(5_738_000 as Weight) | ||
} | ||
// Storage: XcmPallet SupportedVersion (r:1 w:0) | ||
// Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1) | ||
// Storage: XcmPallet SafeXcmVersion (r:1 w:0) | ||
// Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) | ||
// Storage: Dmp DownwardMessageQueues (r:1 w:1) | ||
pub(crate) fn report_error() -> Weight { | ||
(31_512_000 as Weight) | ||
.saturating_add(T::DbWeight::get().reads(5 as Weight)) | ||
.saturating_add(T::DbWeight::get().writes(3 as Weight)) | ||
} | ||
// Storage: XcmPallet AssetTraps (r:1 w:1) | ||
pub(crate) fn claim_asset() -> Weight { | ||
(13_594_000 as Weight) | ||
.saturating_add(T::DbWeight::get().reads(1 as Weight)) | ||
.saturating_add(T::DbWeight::get().writes(1 as Weight)) | ||
} | ||
pub(crate) fn trap() -> Weight { | ||
(5_745_000 as Weight) | ||
} | ||
// Storage: XcmPallet VersionNotifyTargets (r:1 w:1) | ||
// Storage: XcmPallet SupportedVersion (r:1 w:0) | ||
// Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1) | ||
// Storage: XcmPallet SafeXcmVersion (r:1 w:0) | ||
// Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) | ||
// Storage: Dmp DownwardMessageQueues (r:1 w:1) | ||
pub(crate) fn subscribe_version() -> Weight { | ||
(38_138_000 as Weight) | ||
.saturating_add(T::DbWeight::get().reads(6 as Weight)) | ||
.saturating_add(T::DbWeight::get().writes(4 as Weight)) | ||
} | ||
// Storage: XcmPallet VersionNotifyTargets (r:0 w:1) | ||
pub(crate) fn unsubscribe_version() -> Weight { | ||
(9_127_000 as Weight) | ||
.saturating_add(T::DbWeight::get().writes(1 as Weight)) | ||
} | ||
// Storage: XcmPallet SupportedVersion (r:1 w:0) | ||
// Storage: XcmPallet VersionDiscoveryQueue (r:1 w:1) | ||
// Storage: XcmPallet SafeXcmVersion (r:1 w:0) | ||
// Storage: Dmp DownwardMessageQueueHeads (r:1 w:1) | ||
// Storage: Dmp DownwardMessageQueues (r:1 w:1) | ||
pub(crate) fn initiate_reserve_withdraw() -> Weight { | ||
(41_443_000 as Weight) | ||
.saturating_add(T::DbWeight::get().reads(5 as Weight)) | ||
.saturating_add(T::DbWeight::get().writes(3 as Weight)) | ||
} | ||
} |
Oops, something went wrong.