mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 16:17:59 +00:00
Include StorageInfo in Benchmarking Pipeline (#9090)
* extend storageinfo * extend_storage_info * use vec * add storage info to pipeline * get read and written keys * undo storageinfo move * refactor keytracker * return read / write count * playing with key matching * add basic `StorageInfo` constructor * add whitelisted to returned info * fix some test stuff * pipe comments into benchmark data * add_storage_comments * add comments to template * track only storage prefix * Update frame/benchmarking/src/lib.rs * 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 * fix test * 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 test logs * add temp benchmark script * Apply suggestions from code review Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com> * remove keytracker and use trackedstoragekey * add comment for unknown keys * 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 * remove duplicate comments with unknown keys * 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 * 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 * refactor bench tracker, and fix results * 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 * fix child tries in new tracker * extra newline * fix unused warning * 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 * fix master merge * storage info usage refactor * remove now unused * fix refactor * use a vec for prefix * fix tests * also update writer to use vec * disable read and written keys for now * 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 frame/system/src/weights.rs * fix test * Delete weights.rs * reset weights Co-authored-by: Parity Bot <admin@parity.io> Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
This commit is contained in:
@@ -273,9 +273,15 @@ pub fn decl_and_impl(def: &DeclStorageDefExt) -> TokenStream {
|
||||
|
||||
#scrate::sp_std::vec![
|
||||
#scrate::traits::StorageInfo {
|
||||
pallet_name: <
|
||||
#storage_struct as #scrate::#storage_generator_trait
|
||||
>::module_prefix().to_vec(),
|
||||
storage_name: <
|
||||
#storage_struct as #scrate::#storage_generator_trait
|
||||
>::storage_prefix().to_vec(),
|
||||
prefix: <
|
||||
#storage_struct as #scrate::#storage_generator_trait
|
||||
>::storage_value_final_key(),
|
||||
>::storage_value_final_key().to_vec(),
|
||||
max_values: Some(1),
|
||||
max_size: Some(max_size),
|
||||
}
|
||||
@@ -308,10 +314,18 @@ pub fn decl_and_impl(def: &DeclStorageDefExt) -> TokenStream {
|
||||
|
||||
#scrate::sp_std::vec![
|
||||
#scrate::traits::StorageInfo {
|
||||
pallet_name: <
|
||||
#storage_struct
|
||||
as #scrate::storage::StoragePrefixedMap<#value_type>
|
||||
>::module_prefix().to_vec(),
|
||||
storage_name: <
|
||||
#storage_struct
|
||||
as #scrate::storage::StoragePrefixedMap<#value_type>
|
||||
>::storage_prefix().to_vec(),
|
||||
prefix: <
|
||||
#storage_struct
|
||||
as #scrate::storage::StoragePrefixedMap<#value_type>
|
||||
>::final_prefix(),
|
||||
>::final_prefix().to_vec(),
|
||||
max_values: #max_values,
|
||||
max_size: Some(max_size),
|
||||
}
|
||||
@@ -350,10 +364,18 @@ pub fn decl_and_impl(def: &DeclStorageDefExt) -> TokenStream {
|
||||
|
||||
#scrate::sp_std::vec![
|
||||
#scrate::traits::StorageInfo {
|
||||
pallet_name: <
|
||||
#storage_struct
|
||||
as #scrate::storage::StoragePrefixedMap<#value_type>
|
||||
>::module_prefix().to_vec(),
|
||||
storage_name: <
|
||||
#storage_struct
|
||||
as #scrate::storage::StoragePrefixedMap<#value_type>
|
||||
>::storage_prefix().to_vec(),
|
||||
prefix: <
|
||||
#storage_struct
|
||||
as #scrate::storage::StoragePrefixedMap<#value_type>
|
||||
>::final_prefix(),
|
||||
>::final_prefix().to_vec(),
|
||||
max_values: #max_values,
|
||||
max_size: Some(max_size),
|
||||
}
|
||||
@@ -385,10 +407,18 @@ pub fn decl_and_impl(def: &DeclStorageDefExt) -> TokenStream {
|
||||
|
||||
#scrate::sp_std::vec![
|
||||
#scrate::traits::StorageInfo {
|
||||
pallet_name: <
|
||||
#storage_struct
|
||||
as #scrate::storage::StoragePrefixedMap<#value_type>
|
||||
>::module_prefix().to_vec(),
|
||||
storage_name: <
|
||||
#storage_struct
|
||||
as #scrate::storage::StoragePrefixedMap<#value_type>
|
||||
>::storage_prefix().to_vec(),
|
||||
prefix: <
|
||||
#storage_struct
|
||||
as #scrate::storage::StoragePrefixedMap<#value_type>
|
||||
>::final_prefix(),
|
||||
>::final_prefix().to_vec(),
|
||||
max_values: #max_values,
|
||||
max_size: Some(max_size),
|
||||
}
|
||||
@@ -413,9 +443,15 @@ pub fn decl_and_impl(def: &DeclStorageDefExt) -> TokenStream {
|
||||
{
|
||||
#scrate::sp_std::vec![
|
||||
#scrate::traits::StorageInfo {
|
||||
pallet_name: <
|
||||
#storage_struct as #scrate::#storage_generator_trait
|
||||
>::module_prefix().to_vec(),
|
||||
storage_name: <
|
||||
#storage_struct as #scrate::#storage_generator_trait
|
||||
>::storage_prefix().to_vec(),
|
||||
prefix: <
|
||||
#storage_struct as #scrate::#storage_generator_trait
|
||||
>::storage_value_final_key(),
|
||||
>::storage_value_final_key().to_vec(),
|
||||
max_values: Some(1),
|
||||
max_size: None,
|
||||
}
|
||||
@@ -435,10 +471,18 @@ pub fn decl_and_impl(def: &DeclStorageDefExt) -> TokenStream {
|
||||
{
|
||||
#scrate::sp_std::vec![
|
||||
#scrate::traits::StorageInfo {
|
||||
pallet_name: <
|
||||
#storage_struct
|
||||
as #scrate::storage::StoragePrefixedMap<#value_type>
|
||||
>::module_prefix().to_vec(),
|
||||
storage_name: <
|
||||
#storage_struct
|
||||
as #scrate::storage::StoragePrefixedMap<#value_type>
|
||||
>::storage_prefix().to_vec(),
|
||||
prefix: <
|
||||
#storage_struct
|
||||
as #scrate::storage::StoragePrefixedMap<#value_type>
|
||||
>::final_prefix(),
|
||||
>::final_prefix().to_vec(),
|
||||
max_values: #max_values,
|
||||
max_size: None,
|
||||
}
|
||||
@@ -458,10 +502,18 @@ pub fn decl_and_impl(def: &DeclStorageDefExt) -> TokenStream {
|
||||
{
|
||||
#scrate::sp_std::vec![
|
||||
#scrate::traits::StorageInfo {
|
||||
pallet_name: <
|
||||
#storage_struct
|
||||
as #scrate::storage::StoragePrefixedMap<#value_type>
|
||||
>::module_prefix().to_vec(),
|
||||
storage_name: <
|
||||
#storage_struct
|
||||
as #scrate::storage::StoragePrefixedMap<#value_type>
|
||||
>::storage_prefix().to_vec(),
|
||||
prefix: <
|
||||
#storage_struct
|
||||
as #scrate::storage::StoragePrefixedMap<#value_type>
|
||||
>::final_prefix(),
|
||||
>::final_prefix().to_vec(),
|
||||
max_values: #max_values,
|
||||
max_size: None,
|
||||
}
|
||||
@@ -481,10 +533,18 @@ pub fn decl_and_impl(def: &DeclStorageDefExt) -> TokenStream {
|
||||
{
|
||||
#scrate::sp_std::vec![
|
||||
#scrate::traits::StorageInfo {
|
||||
pallet_name: <
|
||||
#storage_struct
|
||||
as #scrate::storage::StoragePrefixedMap<#value_type>
|
||||
>::module_prefix().to_vec(),
|
||||
storage_name: <
|
||||
#storage_struct
|
||||
as #scrate::storage::StoragePrefixedMap<#value_type>
|
||||
>::storage_prefix().to_vec(),
|
||||
prefix: <
|
||||
#storage_struct
|
||||
as #scrate::storage::StoragePrefixedMap<#value_type>
|
||||
>::final_prefix(),
|
||||
>::final_prefix().to_vec(),
|
||||
max_values: #max_values,
|
||||
max_size: None,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user