Skip to content

Commit 69a17bc

Browse files
shawntabrizizadmarbellaParity Benchmarking Bot
authored
New Weight Template + Organization (#7391)
* add_handlebar_template_to_benchmark - add benchmark-cli arg to take in a handlebar-template file * update to always use template * rewrite writer for handlebars * polish * pass cmd data * update docs * new weight layout * separate templates * support custom filename output * Update command.rs * Create frame-weight-template.hbs * use a vector to maintain benchmark order * bring back () * fix tests * fix build * Custom string serializer, remove feature flag * temp * rename * nit * update docs * docs on public objects * small fix * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_balances --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/balances/src/weights.rs --template=./.maintain/frame-weight-template.hbs * remove long line * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_balances --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/balances/src/weights.rs --template=./.maintain/frame-weight-template.hbs * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=frame_system --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/system/src/weights.rs --template=./.maintain/frame-weight-template.hbs * update for system * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/staking/src/weights.rs --template=./.maintain/frame-weight-template.hbs * update for staking * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_identity --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/identity/src/weights.rs --template=./.maintain/frame-weight-template.hbs * update for identity and staking * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_collective --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/collective/src/weights.rs --template=./.maintain/frame-weight-template.hbs * update for collective * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_democracy --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/democracy/src/weights.rs --template=./.maintain/frame-weight-template.hbs * update for democracy * clean up zeros * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_elections_phragmen --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/elections-phragmen/src/weights.rs --template=./.maintain/frame-weight-template.hbs * update for elections phragmen * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_im_online --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/im-online/src/weights.rs --template=./.maintain/frame-weight-template.hbs * update for im online * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_indices --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/indices/src/weights.rs --template=./.maintain/frame-weight-template.hbs * update for indices * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_multisig --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/multisig/src/weights.rs --template=./.maintain/frame-weight-template.hbs * update for multisig * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_proxy --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/proxy/src/weights.rs --template=./.maintain/frame-weight-template.hbs * update for proxy * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_scheduler --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/scheduler/src/weights.rs --template=./.maintain/frame-weight-template.hbs * update for scheduler * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_session --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/session/src/weights.rs --template=./.maintain/frame-weight-template.hbs * update for session * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_timestamp --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/timestamp/src/weights.rs --template=./.maintain/frame-weight-template.hbs * update for timestamp * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_treasury --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/treasury/src/weights.rs --template=./.maintain/frame-weight-template.hbs * update for treasury * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_utility --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/utility/src/weights.rs --template=./.maintain/frame-weight-template.hbs * update for utility * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_vesting --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/vesting/src/weights.rs --template=./.maintain/frame-weight-template.hbs * update for vesting * temp update * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_utility --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/utility/src/weights.rs --template=./.maintain/frame-weight-template.hbs Co-authored-by: Ezadkiel Marbella <zadkiel.m@gmail.com> Co-authored-by: Parity Benchmarking Bot <admin@parity.io>
1 parent b64001b commit 69a17bc

File tree

3 files changed

+318
-160
lines changed

3 files changed

+318
-160
lines changed

src/default_weights.rs

Lines changed: 0 additions & 135 deletions
This file was deleted.

src/lib.rs

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@
7272
7373
#![cfg_attr(not(feature = "std"), no_std)]
7474

75+
#[cfg(test)]
76+
mod tests;
77+
mod benchmarking;
78+
pub mod weights;
79+
7580
use sp_std::prelude::*;
7681
use sp_std::{fmt::Debug, ops::Add, iter::once};
7782
use enumflags2::BitFlags;
@@ -82,37 +87,13 @@ use frame_support::{
8287
decl_module, decl_event, decl_storage, ensure, decl_error,
8388
dispatch::DispatchResultWithPostInfo,
8489
traits::{Currency, ReservableCurrency, OnUnbalanced, Get, BalanceStatus, EnsureOrigin},
85-
weights::Weight,
8690
};
8791
use frame_system::ensure_signed;
88-
89-
#[cfg(test)]
90-
mod tests;
91-
mod benchmarking;
92-
mod default_weights;
92+
pub use weights::WeightInfo;
9393

9494
type BalanceOf<T> = <<T as Trait>::Currency as Currency<<T as frame_system::Trait>::AccountId>>::Balance;
9595
type NegativeImbalanceOf<T> = <<T as Trait>::Currency as Currency<<T as frame_system::Trait>::AccountId>>::NegativeImbalance;
9696

97-
pub trait WeightInfo {
98-
fn add_registrar(r: u32, ) -> Weight;
99-
fn set_identity(r: u32, x: u32, ) -> Weight;
100-
fn set_subs_new(s: u32, ) -> Weight;
101-
fn set_subs_old(p: u32, ) -> Weight;
102-
fn add_sub(p: u32, ) -> Weight;
103-
fn rename_sub(p: u32, ) -> Weight;
104-
fn remove_sub(p: u32, ) -> Weight;
105-
fn quit_sub(p: u32, ) -> Weight;
106-
fn clear_identity(r: u32, s: u32, x: u32, ) -> Weight;
107-
fn request_judgement(r: u32, x: u32, ) -> Weight;
108-
fn cancel_request(r: u32, x: u32, ) -> Weight;
109-
fn set_fee(r: u32, ) -> Weight;
110-
fn set_account_id(r: u32, ) -> Weight;
111-
fn set_fields(r: u32, ) -> Weight;
112-
fn provide_judgement(r: u32, x: u32, ) -> Weight;
113-
fn kill_identity(r: u32, s: u32, x: u32, ) -> Weight;
114-
}
115-
11697
pub trait Trait: frame_system::Trait {
11798
/// The overarching event type.
11899
type Event: From<Event<Self>> + Into<<Self as frame_system::Trait>::Event>;

0 commit comments

Comments
 (0)