Skip to content

Commit

Permalink
contracts: Decrease the interation count on slow benchmarks (parityte…
Browse files Browse the repository at this point in the history
…ch#12526)

* Decrease amount of benchmark iterations for long slow ones

* ".git/.scripts/bench-bot.sh" pallet dev pallet_contracts

Co-authored-by: command-bot <>
  • Loading branch information
athei authored and ark0f committed Feb 27, 2023
1 parent 9ec9c25 commit d694e46
Show file tree
Hide file tree
Showing 2 changed files with 772 additions and 765 deletions.
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

0 comments on commit d694e46

Please sign in to comment.