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
XCM Benchmarks for Generic Instructions #3940
Merged
paritytech-processbot
merged 46 commits into
master
from
shawntabrizi-xcm-generic-benchmarks
Dec 1, 2021
Merged
Changes from 43 commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
16ad36c
initial stuff
shawntabrizi cbd0dc8
Merge branch 'master' into shawntabrizi-xcm-generic-benchmarks
shawntabrizi 82caeec
quick fixes
shawntabrizi e3a0f4a
move to individual tests
shawntabrizi f5b3269
dont need these
shawntabrizi 29bfa5d
Update benchmarking.rs
shawntabrizi ec573a0
add to westend
shawntabrizi e3a7c02
Merge branch 'master' into shawntabrizi-xcm-generic-benchmarks
shawntabrizi 77b1fbd
make benchmarks execute
shawntabrizi 470ce15
fix compile
shawntabrizi 82149ac
add post_execute
shawntabrizi b817e7c
ClaimAsset benchmark working
shawntabrizi 3d9f774
subscribe and unsubscribe benchmarks
shawntabrizi e85c556
benchmark for initiate reserve withdraw
shawntabrizi e64c9ae
Merge branch 'master' into shawntabrizi-xcm-generic-benchmarks
shawntabrizi 3aa3b3c
cargo run --quiet --release --features=runtime-benchmarks -- benchmar…
30c13a2
fix spell check
shawntabrizi 270c283
Merge branch 'master' into shawntabrizi-xcm-generic-benchmarks
shawntabrizi 041b3f4
Merge branch 'master' into shawntabrizi-xcm-generic-benchmarks
shawntabrizi cd190e2
cargo run --quiet --release --features=runtime-benchmarks -- benchmar…
2ee0d81
update worst case for query_holding
shawntabrizi 02248db
Merge branch 'master' of https://github.com/paritytech/polkadot into …
a9a3b29
cargo run --quiet --release --features=runtime-benchmarks -- benchmar…
f51acc3
move verification logic below
shawntabrizi 1e80cfe
introduce worst case holding to initiate reserve withdraw
shawntabrizi 9178fbe
cargo run --quiet --release --features=runtime-benchmarks -- benchmar…
d8da46b
Merge branch 'master' into shawntabrizi-xcm-generic-benchmarks
shawntabrizi 978b015
Merge branch 'master' into shawntabrizi-xcm-generic-benchmarks
shawntabrizi 23602ca
feedback
shawntabrizi 21fde67
Merge branch 'master' into shawntabrizi-xcm-generic-benchmarks
shawntabrizi 2779039
cargo run --quiet --release --features=runtime-benchmarks -- benchmar…
98964be
Revert "cargo run --quiet --release --features=runtime-benchmarks -- …
shawntabrizi 4939b63
fix benchmark template
shawntabrizi be2036d
cargo run --quiet --release --features=runtime-benchmarks -- benchmar…
4efd026
use response::version
shawntabrizi 6c0ceed
Merge branch 'master' of https://github.com/paritytech/polkadot into …
77b183f
cargo run --quiet --release --features=runtime-benchmarks -- benchmar…
d783d40
refactor worst case holding
shawntabrizi 2a9582b
Merge branch 'shawntabrizi-xcm-generic-benchmarks' of https://github.…
shawntabrizi 6512a26
cargo run --quiet --release --features=runtime-benchmarks -- benchmar…
df66c1f
fmt
shawntabrizi fc51779
Merge branch 'shawntabrizi-xcm-generic-benchmarks' of https://github.…
shawntabrizi cd0f4b8
one more todo needs to be labeled
shawntabrizi b7e3ced
change option to result with benchmark error
shawntabrizi 3c4dcb4
fmt and fix import
shawntabrizi a9ea6c1
Merge branch 'master' into shawntabrizi-xcm-generic-benchmarks
shawntabrizi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.