From 826cf43a102595e13f194f8047d5204859737c3b Mon Sep 17 00:00:00 2001 From: xgreenx Date: Fri, 10 Nov 2023 08:56:59 +0000 Subject: [PATCH] Decrease number of iterations for sequential benchmarks --- benches/benches/vm_set/blockchain.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/benches/benches/vm_set/blockchain.rs b/benches/benches/vm_set/blockchain.rs index 6ec606ab13e..a555d80b6d7 100644 --- a/benches/benches/vm_set/blockchain.rs +++ b/benches/benches/vm_set/blockchain.rs @@ -96,8 +96,11 @@ impl BenchDb { pub fn run(c: &mut Criterion) { let rng = &mut StdRng::seed_from_u64(2322u64); + const LAST_VALUE: u64 = 100_000; let mut linear: Vec = vec![1, 10, 100, 1000, 10_000]; - let mut l = successors(Some(100_000.0f64), |n| Some(n / 1.5)) + let mut linear_short = linear.clone(); + linear_short.push(LAST_VALUE); + let mut l = successors(Some(LAST_VALUE as f64), |n| Some(n / 1.5)) .take(5) .map(|f| f as u64) .collect::>(); @@ -142,7 +145,7 @@ pub fn run(c: &mut Criterion) { let mut scwq = c.benchmark_group("scwq"); - for i in linear.clone() { + for i in linear_short.clone() { let start_key = Bytes32::zeroed(); let data = start_key.iter().copied().collect::>(); @@ -168,7 +171,7 @@ pub fn run(c: &mut Criterion) { let mut swwq = c.benchmark_group("swwq"); - for i in linear.clone() { + for i in linear_short.clone() { let start_key = Bytes32::zeroed(); let data = start_key.iter().copied().collect::>(); @@ -521,7 +524,7 @@ pub fn run(c: &mut Criterion) { let mut srwq = c.benchmark_group("srwq"); - for i in linear.clone() { + for i in linear_short.clone() { let start_key = Bytes32::zeroed(); let data = start_key.iter().copied().collect::>();