Skip to content

Commit

Permalink
Merge pull request #114 from HorizenLabs/gp/run_benchmarks
Browse files Browse the repository at this point in the history
Gp/run benchmarks
  • Loading branch information
JackPiri committed Aug 8, 2024
2 parents d7a685f + fa770f5 commit 578b810
Show file tree
Hide file tree
Showing 26 changed files with 1,481 additions and 973 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "zkv-runtime"
version = "0.5.0"
version = "0.5.1"
description = "zkVerify Mainchain Runtime."
authors.workspace = true
homepage = "https://github.com/HorizenLabs/zkVerify"
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// The version of the runtime specification. A full node will not attempt to use its native
// runtime in substitute for the on-chain Wasm runtime unless all of `spec_name`,
// `spec_version`, and `authoring_version` are the same between Wasm and native.
spec_version: 5_000,
spec_version: 5_001,
impl_version: 1,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down
4 changes: 2 additions & 2 deletions runtime/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ mod use_correct_weights {
&Vec::new(),
&Vec::new()
),
crate::weights::pallet_risc0_verifier::ZKVWeight::<Runtime>::submit_proof_cycle_2_pow_12()
crate::weights::pallet_risc0_verifier::ZKVWeight::<Runtime>::submit_proof_cycle_2_pow_13()
);
}

Expand All @@ -609,7 +609,7 @@ mod use_correct_weights {
&vec![0; pallet_ultraplonk_verifier::PROOF_SIZE],
&Vec::new()
),
crate::weights::pallet_ultraplonk_verifier::ZKVWeight::<Runtime>::submit_proof()
crate::weights::pallet_ultraplonk_verifier::ZKVWeight::<Runtime>::submit_proof_32()
);
}

Expand Down
23 changes: 12 additions & 11 deletions runtime/src/weights/block_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 31.0.0
//! DATE: 2024-06-11 (Y/M/D)
//! HOSTNAME: `5c563fea5723`, CPU: `AMD EPYC 7571`
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 36.0.0
//! DATE: 2024-08-07 (Y/M/D)
//! HOSTNAME: `c0ae48dc3b2e`, CPU: `AMD Ryzen 7 7700 8-Core Processor`
//!
//! SHORT-NAME: `block`, LONG-NAME: `BlockExecution`, RUNTIME: `Development`
//! WARMUPS: `10`, REPEAT: `100`
Expand All @@ -31,6 +31,7 @@
// --header=/data/benchmark/HEADER-APACHE2
// --warmup=10
// --repeat=100
// --base-path=/tmp/tmp.3HgX1SvP0b

use sp_core::parameter_types;
use sp_weights::{constants::WEIGHT_REF_TIME_PER_NANOS, Weight};
Expand All @@ -40,17 +41,17 @@ parameter_types! {
/// Calculated by multiplying the *Average* with `1.0` and adding `0`.
///
/// Stats nanoseconds:
/// Min, Max: 412_066, 812_043
/// Average: 429_404
/// Median: 417_277
/// Std-Dev: 43580.22
/// Min, Max: 173_345, 231_645
/// Average: 178_364
/// Median: 176_140
/// Std-Dev: 7557.13
///
/// Percentiles nanoseconds:
/// 99th: 502_958
/// 95th: 490_558
/// 75th: 421_856
/// 99th: 217_288
/// 95th: 185_148
/// 75th: 179_066
pub const BlockExecutionWeight: Weight =
Weight::from_parts(WEIGHT_REF_TIME_PER_NANOS.saturating_mul(429_404), 0);
Weight::from_parts(WEIGHT_REF_TIME_PER_NANOS.saturating_mul(178_364), 0);
}

#[cfg(test)]
Expand Down
40 changes: 20 additions & 20 deletions runtime/src/weights/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
// limitations under the License.

//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 36.0.0
//! DATE: 2024-08-01 (Y/M/D)
//! HOSTNAME: `miklap`, CPU: `11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz`
//! DATE: 2024-08-07 (Y/M/D)
//! HOSTNAME: `bench1.fi`, CPU: `AMD Ryzen 7 7700 8-Core Processor`
//!
//! DATABASE: `RocksDb`, RUNTIME: `ZKV Testnet`
//! BLOCK-NUM: `BlockId::Number(1130146)`
//! BLOCK-NUM: `BlockId::Number(1213797)`
//! SKIP-WRITE: `false`, SKIP-READ: `false`, WARMUPS: `1`
//! STATE-VERSION: `V1`, STATE-CACHE-SIZE: ``
//! WEIGHT-PATH: `runtime/src/weights/db.rs`
Expand All @@ -39,7 +39,7 @@
// --weight-path
// runtime/src/weights/db.rs
// -d
// /home/mdamico/.local/share/zkv-node/
// /home/giacomo/zkv-node

/// Storage DB weights for the `ZKV Testnet` runtime and `RocksDb`.
pub mod constants {
Expand All @@ -55,31 +55,31 @@ pub mod constants {
// Calculated by multiplying the *Average* of all values with `1.1` and adding `0`.
//
// Stats nanoseconds:
// Min, Max: 1_387, 105_875
// Average: 10_263
// Median: 10_546
// Std-Dev: 2515.65
// Min, Max: 972, 28_764
// Average: 6_810
// Median: 7_133
// Std-Dev: 1328.79
//
// Percentiles nanoseconds:
// 99th: 17_430
// 95th: 13_004
// 75th: 11_234
read: 11_290 * constants::WEIGHT_REF_TIME_PER_NANOS,
// 99th: 9_467
// 95th: 8_526
// 75th: 7_474
read: 7_492 * constants::WEIGHT_REF_TIME_PER_NANOS,

// Time to write one storage item.
// Calculated by multiplying the *Average* of all values with `1.1` and adding `0`.
//
// Stats nanoseconds:
// Min, Max: 8_948, 1_479_986
// Average: 23_656
// Median: 17_285
// Std-Dev: 17004.92
// Min, Max: 7_945, 1_994_029
// Average: 20_322
// Median: 15_449
// Std-Dev: 19581.04
//
// Percentiles nanoseconds:
// 99th: 45_935
// 95th: 41_207
// 75th: 34_361
write: 26_022 * constants::WEIGHT_REF_TIME_PER_NANOS,
// 99th: 37_179
// 95th: 34_014
// 75th: 28_764
write: 22_355 * constants::WEIGHT_REF_TIME_PER_NANOS,
};
}

Expand Down
23 changes: 12 additions & 11 deletions runtime/src/weights/extrinsic_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 31.0.0
//! DATE: 2024-06-11 (Y/M/D)
//! HOSTNAME: `5c563fea5723`, CPU: `AMD EPYC 7571`
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 36.0.0
//! DATE: 2024-08-07 (Y/M/D)
//! HOSTNAME: `c0ae48dc3b2e`, CPU: `AMD Ryzen 7 7700 8-Core Processor`
//!
//! SHORT-NAME: `extrinsic`, LONG-NAME: `ExtrinsicBase`, RUNTIME: `Development`
//! WARMUPS: `10`, REPEAT: `100`
Expand All @@ -31,6 +31,7 @@
// --header=/data/benchmark/HEADER-APACHE2
// --warmup=10
// --repeat=100
// --base-path=/tmp/tmp.3HgX1SvP0b

use sp_core::parameter_types;
use sp_weights::{constants::WEIGHT_REF_TIME_PER_NANOS, Weight};
Expand All @@ -40,17 +41,17 @@ parameter_types! {
/// Calculated by multiplying the *Average* with `1.0` and adding `0`.
///
/// Stats nanoseconds:
/// Min, Max: 207_389, 258_339
/// Average: 223_366
/// Median: 219_598
/// Std-Dev: 13056.44
/// Min, Max: 74_083, 74_666
/// Average: 74_283
/// Median: 74_248
/// Std-Dev: 134.6
///
/// Percentiles nanoseconds:
/// 99th: 256_065
/// 95th: 250_965
/// 75th: 231_861
/// 99th: 74_633
/// 95th: 74_496
/// 75th: 74_394
pub const ExtrinsicBaseWeight: Weight =
Weight::from_parts(WEIGHT_REF_TIME_PER_NANOS.saturating_mul(223_366), 0);
Weight::from_parts(WEIGHT_REF_TIME_PER_NANOS.saturating_mul(74_283), 0);
}

#[cfg(test)]
Expand Down
58 changes: 37 additions & 21 deletions runtime/src/weights/frame_election_provider_support.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
// Copyright 2024, Horizen Labs, Inc.
// SPDX-License-Identifier: Apache-2.0

//! Autogenerated weights for `pallet_election_provider_support_benchmarking`
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//! Autogenerated weights for `frame_election_provider_support`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 31.0.0
//! DATE: 2024-07-23, STEPS: `50`, REPEAT: `30`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 36.0.0
//! DATE: 2024-08-07, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `3f2a763097a9`, CPU: `AMD Ryzen 7 7700 8-Core Processor`
//! HOSTNAME: `29baa354ec7e`, CPU: `AMD Ryzen 7 7700 8-Core Processor`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024`

// Executed Command:
Expand All @@ -13,20 +27,22 @@
// pallet
// --chain
// dev
// --execution=wasm
// --wasm-execution=compiled
// --pallet
// pallet_election_provider_support_benchmarking
// frame-election-provider-support
// --extrinsic
// *
// --steps
// 50
// --repeat
// 30
// 20
// --heap-pages=4096
// --header
// /data/benchmark/HEADER-APACHE2
// --output
// /data/benchmark/runtime/src/weights/pallet_election_provider_support.rs
// /data/benchmark/runtime/src/weights/frame_election_provider_support.rs
// --template
// /data/benchmark/node/zkv-deploy-weight-template.hbs
// --base-path=/tmp/tmp.3HgX1SvP0b

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
Expand All @@ -47,12 +63,12 @@ impl<T: frame_system::Config> frame_election_provider_support::WeightInfo for ZK
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 6_541_418_000 picoseconds.
Weight::from_parts(6_650_834_000, 0)
// Standard Error: 103_841
.saturating_add(Weight::from_parts(5_707_216, 0).saturating_mul(v.into()))
// Standard Error: 10_768_292
.saturating_add(Weight::from_parts(1_255_929_260, 0).saturating_mul(d.into()))
// Minimum execution time: 6_699_583_000 picoseconds.
Weight::from_parts(6_746_881_000, 0)
// Standard Error: 123_813
.saturating_add(Weight::from_parts(5_264_043, 0).saturating_mul(v.into()))
// Standard Error: 12_658_286
.saturating_add(Weight::from_parts(1_253_512_368, 0).saturating_mul(d.into()))
}
/// The range of component `v` is `[1000, 2000]`.
/// The range of component `t` is `[500, 1000]`.
Expand All @@ -61,11 +77,11 @@ impl<T: frame_system::Config> frame_election_provider_support::WeightInfo for ZK
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 4_721_052_000 picoseconds.
Weight::from_parts(4_929_883_000, 0)
// Standard Error: 81_693
.saturating_add(Weight::from_parts(4_357_062, 0).saturating_mul(v.into()))
// Standard Error: 8_471_492
.saturating_add(Weight::from_parts(1_097_083_776, 0).saturating_mul(d.into()))
// Minimum execution time: 4_613_852_000 picoseconds.
Weight::from_parts(4_641_895_000, 0)
// Standard Error: 102_187
.saturating_add(Weight::from_parts(4_292_278, 0).saturating_mul(v.into()))
// Standard Error: 10_447_307
.saturating_add(Weight::from_parts(1_135_693_885, 0).saturating_mul(d.into()))
}
}
Loading

0 comments on commit 578b810

Please sign in to comment.