change $location from tt* to ty and remove unnecessary cb_* versions (#14571)

* change $location from tt* to ty and remove unnecessary cb_* versions

* fmt

* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_balances

---------

Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
Co-authored-by: parity-processbot <>
This commit is contained in:
Marijn Schouten
2023-07-14 14:43:24 +02:00
committed by GitHub
parent 242e31ec2d
commit 70694b903a
2 changed files with 53 additions and 86 deletions
+40 -41
View File
@@ -18,10 +18,10 @@
//! Autogenerated weights for pallet_balances
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-07-07, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-07-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-xerhrdyb-project-145-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024`
//! HOSTNAME: `runner-o7yfgx5n-project-145-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024`
// Executed Command:
// target/production/substrate
@@ -30,11 +30,10 @@
// --steps=50
// --repeat=20
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --json-file=/builds/parity/mirrors/substrate/.git/.artifacts/bench.json
// --pallet=pallet-balances
// --pallet=pallet_balances
// --chain=dev
// --header=./HEADER-APACHE2
// --output=./frame/balances/src/weights.rs
@@ -69,8 +68,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `3593`
// Minimum execution time: 58_450_000 picoseconds.
Weight::from_parts(59_566_000, 3593)
// Minimum execution time: 58_474_000 picoseconds.
Weight::from_parts(59_117_000, 3593)
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -80,8 +79,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `3593`
// Minimum execution time: 44_753_000 picoseconds.
Weight::from_parts(46_235_000, 3593)
// Minimum execution time: 44_629_000 picoseconds.
Weight::from_parts(45_798_000, 3593)
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -91,8 +90,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `174`
// Estimated: `3593`
// Minimum execution time: 16_771_000 picoseconds.
Weight::from_parts(17_172_000, 3593)
// Minimum execution time: 16_483_000 picoseconds.
Weight::from_parts(16_939_000, 3593)
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -102,8 +101,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `174`
// Estimated: `3593`
// Minimum execution time: 24_196_000 picoseconds.
Weight::from_parts(24_925_000, 3593)
// Minimum execution time: 24_638_000 picoseconds.
Weight::from_parts(25_487_000, 3593)
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -113,8 +112,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `103`
// Estimated: `6196`
// Minimum execution time: 60_133_000 picoseconds.
Weight::from_parts(61_069_000, 6196)
// Minimum execution time: 60_041_000 picoseconds.
Weight::from_parts(63_365_000, 6196)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(2_u64))
}
@@ -124,8 +123,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `3593`
// Minimum execution time: 53_938_000 picoseconds.
Weight::from_parts(55_123_000, 3593)
// Minimum execution time: 54_445_000 picoseconds.
Weight::from_parts(55_623_000, 3593)
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -135,8 +134,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `174`
// Estimated: `3593`
// Minimum execution time: 19_914_000 picoseconds.
Weight::from_parts(20_435_000, 3593)
// Minimum execution time: 19_309_000 picoseconds.
Weight::from_parts(19_953_000, 3593)
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -147,10 +146,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `0 + u * (135 ±0)`
// Estimated: `990 + u * (2603 ±0)`
// Minimum execution time: 19_319_000 picoseconds.
Weight::from_parts(19_644_000, 990)
// Standard Error: 11_800
.saturating_add(Weight::from_parts(16_340_188, 0).saturating_mul(u.into()))
// Minimum execution time: 19_362_000 picoseconds.
Weight::from_parts(19_612_000, 990)
// Standard Error: 13_108
.saturating_add(Weight::from_parts(16_444_591, 0).saturating_mul(u.into()))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(u.into())))
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(u.into())))
.saturating_add(Weight::from_parts(0, 2603).saturating_mul(u.into()))
@@ -165,8 +164,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `3593`
// Minimum execution time: 58_450_000 picoseconds.
Weight::from_parts(59_566_000, 3593)
// Minimum execution time: 58_474_000 picoseconds.
Weight::from_parts(59_117_000, 3593)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -176,8 +175,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `3593`
// Minimum execution time: 44_753_000 picoseconds.
Weight::from_parts(46_235_000, 3593)
// Minimum execution time: 44_629_000 picoseconds.
Weight::from_parts(45_798_000, 3593)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -187,8 +186,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `174`
// Estimated: `3593`
// Minimum execution time: 16_771_000 picoseconds.
Weight::from_parts(17_172_000, 3593)
// Minimum execution time: 16_483_000 picoseconds.
Weight::from_parts(16_939_000, 3593)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -198,8 +197,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `174`
// Estimated: `3593`
// Minimum execution time: 24_196_000 picoseconds.
Weight::from_parts(24_925_000, 3593)
// Minimum execution time: 24_638_000 picoseconds.
Weight::from_parts(25_487_000, 3593)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -209,8 +208,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `103`
// Estimated: `6196`
// Minimum execution time: 60_133_000 picoseconds.
Weight::from_parts(61_069_000, 6196)
// Minimum execution time: 60_041_000 picoseconds.
Weight::from_parts(63_365_000, 6196)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(2_u64))
}
@@ -220,8 +219,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `3593`
// Minimum execution time: 53_938_000 picoseconds.
Weight::from_parts(55_123_000, 3593)
// Minimum execution time: 54_445_000 picoseconds.
Weight::from_parts(55_623_000, 3593)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -231,8 +230,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `174`
// Estimated: `3593`
// Minimum execution time: 19_914_000 picoseconds.
Weight::from_parts(20_435_000, 3593)
// Minimum execution time: 19_309_000 picoseconds.
Weight::from_parts(19_953_000, 3593)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -243,10 +242,10 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `0 + u * (135 ±0)`
// Estimated: `990 + u * (2603 ±0)`
// Minimum execution time: 19_319_000 picoseconds.
Weight::from_parts(19_644_000, 990)
// Standard Error: 11_800
.saturating_add(Weight::from_parts(16_340_188, 0).saturating_mul(u.into()))
// Minimum execution time: 19_362_000 picoseconds.
Weight::from_parts(19_612_000, 990)
// Standard Error: 13_108
.saturating_add(Weight::from_parts(16_444_591, 0).saturating_mul(u.into()))
.saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(u.into())))
.saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(u.into())))
.saturating_add(Weight::from_parts(0, 2603).saturating_mul(u.into()))
+13 -45
View File
@@ -1826,9 +1826,9 @@ pub fn show_benchmark_debug_info(
/// ```
#[macro_export]
macro_rules! add_benchmark {
( $params:ident, $batches:ident, $name:path, $( $location:tt )* ) => (
( $params:ident, $batches:ident, $name:path, $location:ty ) => {
let name_string = stringify!($name).as_bytes();
let instance_string = stringify!( $( $location )* ).as_bytes();
let instance_string = stringify!($location).as_bytes();
let (config, whitelist) = $params;
let $crate::BenchmarkConfig {
pallet,
@@ -1838,7 +1838,7 @@ macro_rules! add_benchmark {
internal_repeats,
} = config;
if &pallet[..] == &name_string[..] {
let benchmark_result = $( $location )*::run_benchmark(
let benchmark_result = <$location>::run_benchmark(
&benchmark[..],
&selected_components[..],
whitelist,
@@ -1855,9 +1855,7 @@ macro_rules! add_benchmark {
$crate::str::from_utf8(benchmark)
.expect("benchmark name is always a valid string!")
);
result.keys.insert(0,
(b"Benchmark Override".to_vec(), 0, 0, false)
);
result.keys.insert(0, (b"Benchmark Override".to_vec(), 0, 0, false));
Some($crate::vec![result])
},
Err($crate::BenchmarkError::Stop(e)) => {
@@ -1868,7 +1866,7 @@ macro_rules! add_benchmark {
verify,
e,
);
return Err(e.into());
return Err(e.into())
},
Err($crate::BenchmarkError::Skip) => {
$crate::log::error!(
@@ -1886,9 +1884,9 @@ macro_rules! add_benchmark {
);
Some(vec![$crate::BenchmarkResult {
components: selected_components.clone(),
.. Default::default()
..Default::default()
}])
}
},
};
if let Some(final_results) = final_results {
@@ -1900,21 +1898,7 @@ macro_rules! add_benchmark {
});
}
}
)
}
/// Callback for `define_benchmarks` to call `add_benchmark`.
#[macro_export]
macro_rules! cb_add_benchmarks {
// anchor
( $params:ident, $batches:ident, [ $name:path, $( $location:tt )* ] ) => {
$crate::add_benchmark!( $params, $batches, $name, $( $location )* );
};
// recursion tail
( $params:ident, $batches:ident, [ $name:path, $( $location:tt )* ] $([ $names:path, $( $locations:tt )* ])+ ) => {
$crate::cb_add_benchmarks!( $params, $batches, [ $name, $( $location )* ] );
$crate::cb_add_benchmarks!( $params, $batches, $([ $names, $( $locations )* ])+ );
}
}
/// This macro allows users to easily generate a list of benchmarks for the pallets configured
@@ -1938,31 +1922,17 @@ macro_rules! cb_add_benchmarks {
/// This should match what exists with the `add_benchmark!` macro.
#[macro_export]
macro_rules! list_benchmark {
( $list:ident, $extra:ident, $name:path, $( $location:tt )* ) => (
( $list:ident, $extra:ident, $name:path, $location:ty ) => {
let pallet_string = stringify!($name).as_bytes();
let instance_string = stringify!( $( $location )* ).as_bytes();
let benchmarks = $( $location )*::benchmarks($extra);
let instance_string = stringify!($location).as_bytes();
let benchmarks = <$location>::benchmarks($extra);
let pallet_benchmarks = BenchmarkList {
pallet: pallet_string.to_vec(),
instance: instance_string.to_vec(),
benchmarks: benchmarks.to_vec(),
};
$list.push(pallet_benchmarks)
)
}
/// Callback for `define_benchmarks` to call `list_benchmark`.
#[macro_export]
macro_rules! cb_list_benchmarks {
// anchor
( $list:ident, $extra:ident, [ $name:path, $( $location:tt )* ] ) => {
$crate::list_benchmark!( $list, $extra, $name, $( $location )* );
};
// recursion tail
( $list:ident, $extra:ident, [ $name:path, $( $location:tt )* ] $([ $names:path, $( $locations:tt )* ])+ ) => {
$crate::cb_list_benchmarks!( $list, $extra, [ $name, $( $location )* ] );
$crate::cb_list_benchmarks!( $list, $extra, $([ $names, $( $locations )* ])+ );
}
}
/// Defines pallet configs that `add_benchmarks` and `list_benchmarks` use.
@@ -1970,7 +1940,7 @@ macro_rules! cb_list_benchmarks {
/// in `add_benchmark` and `list_benchmark`.
#[macro_export]
macro_rules! define_benchmarks {
( $([ $names:path, $( $locations:tt )* ])* ) => {
( $([ $names:path, $locations:ty ])* ) => {
/// Calls `list_benchmark` with all configs from `define_benchmarks`
/// and passes the first two parameters on.
///
@@ -1981,7 +1951,7 @@ macro_rules! define_benchmarks {
#[macro_export]
macro_rules! list_benchmarks {
( $list:ident, $extra:ident ) => {
$crate::cb_list_benchmarks!( $list, $extra, $([ $names, $( $locations )* ])+ );
$( $crate::list_benchmark!( $list, $extra, $names, $locations); )*
}
}
@@ -1995,7 +1965,7 @@ macro_rules! define_benchmarks {
#[macro_export]
macro_rules! add_benchmarks {
( $params:ident, $batches:ident ) => {
$crate::cb_add_benchmarks!( $params, $batches, $([ $names, $( $locations )* ])+ );
$( $crate::add_benchmark!( $params, $batches, $names, $locations ); )*
}
}
}
@@ -2007,8 +1977,6 @@ pub use benchmarks;
pub use benchmarks_instance;
pub use benchmarks_instance_pallet;
pub use benchmarks_iter;
pub use cb_add_benchmarks;
pub use cb_list_benchmarks;
pub use define_benchmarks;
pub use impl_bench_case_tests;
pub use impl_bench_name_tests;