Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

contracts: Decrease the interation count on slow benchmarks #12526

Merged
merged 2 commits into from
Oct 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions frame/contracts/src/benchmarking/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1890,7 +1890,7 @@ benchmarks! {

// Only the overhead of calling the function itself with minimal arguments.
seal_hash_sha2_256 {
let r in 0 .. API_BENCHMARK_BATCHES;
let r in 0 .. 1;
let instance = Contract::<T>::new(WasmModule::hasher(
"seal_hash_sha2_256", r * API_BENCHMARK_BATCH_SIZE, 0,
), vec![])?;
Expand All @@ -1908,7 +1908,7 @@ benchmarks! {

// Only the overhead of calling the function itself with minimal arguments.
seal_hash_keccak_256 {
let r in 0 .. API_BENCHMARK_BATCHES;
let r in 0 .. 1;
let instance = Contract::<T>::new(WasmModule::hasher(
"seal_hash_keccak_256", r * API_BENCHMARK_BATCH_SIZE, 0,
), vec![])?;
Expand All @@ -1926,7 +1926,7 @@ benchmarks! {

// Only the overhead of calling the function itself with minimal arguments.
seal_hash_blake2_256 {
let r in 0 .. API_BENCHMARK_BATCHES;
let r in 0 .. 1;
let instance = Contract::<T>::new(WasmModule::hasher(
"seal_hash_blake2_256", r * API_BENCHMARK_BATCH_SIZE, 0,
), vec![])?;
Expand All @@ -1944,7 +1944,7 @@ benchmarks! {

// Only the overhead of calling the function itself with minimal arguments.
seal_hash_blake2_128 {
let r in 0 .. API_BENCHMARK_BATCHES;
let r in 0 .. 1;
let instance = Contract::<T>::new(WasmModule::hasher(
"seal_hash_blake2_128", r * API_BENCHMARK_BATCH_SIZE, 0,
), vec![])?;
Expand All @@ -1963,7 +1963,7 @@ benchmarks! {
// Only calling the function itself with valid arguments.
// It generates different private keys and signatures for the message "Hello world".
seal_ecdsa_recover {
let r in 0 .. API_BENCHMARK_BATCHES;
let r in 0 .. 1;

let message_hash = sp_io::hashing::blake2_256("Hello world".as_bytes());
let key_type = sp_core::crypto::KeyTypeId(*b"code");
Expand Down Expand Up @@ -2011,7 +2011,7 @@ benchmarks! {
// Only calling the function itself for the list of
// generated different ECDSA keys.
seal_ecdsa_to_eth_address {
let r in 0 .. API_BENCHMARK_BATCHES;
let r in 0 .. 1;
let key_type = sp_core::crypto::KeyTypeId(*b"code");
let pub_keys_bytes = (0..r * API_BENCHMARK_BATCH_SIZE)
.map(|_| {
Expand Down
Loading