mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 21:37:56 +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:
@@ -1171,54 +1171,74 @@ fn test_storage_info() {
|
||||
Example::storage_info(),
|
||||
vec![
|
||||
StorageInfo {
|
||||
prefix: prefix(b"Example", b"ValueWhereClause"),
|
||||
pallet_name: b"Example".to_vec(),
|
||||
storage_name: b"ValueWhereClause".to_vec(),
|
||||
prefix: prefix(b"Example", b"ValueWhereClause").to_vec(),
|
||||
max_values: Some(1),
|
||||
max_size: Some(8),
|
||||
},
|
||||
StorageInfo {
|
||||
prefix: prefix(b"Example", b"Value"),
|
||||
pallet_name: b"Example".to_vec(),
|
||||
storage_name: b"Value".to_vec(),
|
||||
prefix: prefix(b"Example", b"Value").to_vec(),
|
||||
max_values: Some(1),
|
||||
max_size: Some(4),
|
||||
},
|
||||
StorageInfo {
|
||||
prefix: prefix(b"Example", b"Value2"),
|
||||
pallet_name: b"Example".to_vec(),
|
||||
storage_name: b"Value2".to_vec(),
|
||||
prefix: prefix(b"Example", b"Value2").to_vec(),
|
||||
max_values: Some(1),
|
||||
max_size: Some(8),
|
||||
},
|
||||
StorageInfo {
|
||||
prefix: prefix(b"Example", b"Map"),
|
||||
pallet_name: b"Example".to_vec(),
|
||||
storage_name: b"Map".to_vec(),
|
||||
prefix: prefix(b"Example", b"Map").to_vec(),
|
||||
max_values: None,
|
||||
max_size: Some(3 + 16),
|
||||
},
|
||||
StorageInfo {
|
||||
prefix: prefix(b"Example", b"Map2"),
|
||||
pallet_name: b"Example".to_vec(),
|
||||
storage_name: b"Map2".to_vec(),
|
||||
prefix: prefix(b"Example", b"Map2").to_vec(),
|
||||
max_values: Some(3),
|
||||
max_size: Some(6 + 8),
|
||||
},
|
||||
StorageInfo {
|
||||
prefix: prefix(b"Example", b"DoubleMap"),
|
||||
pallet_name: b"Example".to_vec(),
|
||||
storage_name: b"DoubleMap".to_vec(),
|
||||
prefix: prefix(b"Example", b"DoubleMap").to_vec(),
|
||||
max_values: None,
|
||||
max_size: Some(7 + 16 + 8),
|
||||
},
|
||||
StorageInfo {
|
||||
prefix: prefix(b"Example", b"DoubleMap2"),
|
||||
pallet_name: b"Example".to_vec(),
|
||||
storage_name: b"DoubleMap2".to_vec(),
|
||||
prefix: prefix(b"Example", b"DoubleMap2").to_vec(),
|
||||
max_values: Some(5),
|
||||
max_size: Some(14 + 8 + 16),
|
||||
},
|
||||
StorageInfo {
|
||||
prefix: prefix(b"Example", b"NMap"),
|
||||
pallet_name: b"Example".to_vec(),
|
||||
storage_name: b"NMap".to_vec(),
|
||||
prefix: prefix(b"Example", b"NMap").to_vec(),
|
||||
max_values: None,
|
||||
max_size: Some(5 + 16),
|
||||
},
|
||||
StorageInfo {
|
||||
prefix: prefix(b"Example", b"NMap2"),
|
||||
pallet_name: b"Example".to_vec(),
|
||||
storage_name: b"NMap2".to_vec(),
|
||||
prefix: prefix(b"Example", b"NMap2").to_vec(),
|
||||
max_values: Some(11),
|
||||
max_size: Some(14 + 8 + 16),
|
||||
},
|
||||
#[cfg(feature = "conditional-storage")]
|
||||
{
|
||||
StorageInfo {
|
||||
prefix: prefix(b"Example", b"ConditionalValue"),
|
||||
pallet_name: b"Example".to_vec(),
|
||||
storage_name: b"ConditionalValue".to_vec(),
|
||||
prefix: prefix(b"Example", b"ConditionalValue").to_vec(),
|
||||
max_values: Some(1),
|
||||
max_size: Some(4),
|
||||
}
|
||||
@@ -1226,7 +1246,9 @@ fn test_storage_info() {
|
||||
#[cfg(feature = "conditional-storage")]
|
||||
{
|
||||
StorageInfo {
|
||||
prefix: prefix(b"Example", b"ConditionalMap"),
|
||||
pallet_name: b"Example".to_vec(),
|
||||
storage_name: b"ConditionalMap".to_vec(),
|
||||
prefix: prefix(b"Example", b"ConditionalMap").to_vec(),
|
||||
max_values: Some(12),
|
||||
max_size: Some(6 + 8),
|
||||
}
|
||||
@@ -1234,7 +1256,9 @@ fn test_storage_info() {
|
||||
#[cfg(feature = "conditional-storage")]
|
||||
{
|
||||
StorageInfo {
|
||||
prefix: prefix(b"Example", b"ConditionalDoubleMap"),
|
||||
pallet_name: b"Example".to_vec(),
|
||||
storage_name: b"ConditionalDoubleMap".to_vec(),
|
||||
prefix: prefix(b"Example", b"ConditionalDoubleMap").to_vec(),
|
||||
max_values: None,
|
||||
max_size: Some(7 + 16 + 8),
|
||||
}
|
||||
@@ -1242,7 +1266,9 @@ fn test_storage_info() {
|
||||
#[cfg(feature = "conditional-storage")]
|
||||
{
|
||||
StorageInfo {
|
||||
prefix: prefix(b"Example", b"ConditionalNMap"),
|
||||
pallet_name: b"Example".to_vec(),
|
||||
storage_name: b"ConditionalNMap".to_vec(),
|
||||
prefix: prefix(b"Example", b"ConditionalNMap").to_vec(),
|
||||
max_values: None,
|
||||
max_size: Some(7 + 16 + 8),
|
||||
}
|
||||
@@ -1254,7 +1280,9 @@ fn test_storage_info() {
|
||||
Example2::storage_info(),
|
||||
vec![
|
||||
StorageInfo {
|
||||
prefix: prefix(b"Example2", b"SomeValue"),
|
||||
pallet_name: b"Example2".to_vec(),
|
||||
storage_name: b"SomeValue".to_vec(),
|
||||
prefix: prefix(b"Example2", b"SomeValue").to_vec(),
|
||||
max_values: Some(1),
|
||||
max_size: None,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user