Skip to content

Commit

Permalink
Decrease number of iterations for sequential benchmarks (#1480)
Browse files Browse the repository at this point in the history
  • Loading branch information
xgreenx authored Nov 10, 2023
1 parent 1581546 commit ab440ee
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions benches/benches/vm_set/blockchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<u64> = 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::<Vec<_>>();
Expand Down Expand Up @@ -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::<Vec<_>>();

Expand All @@ -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::<Vec<_>>();

Expand Down Expand Up @@ -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::<Vec<_>>();

Expand Down

0 comments on commit ab440ee

Please sign in to comment.