Skip to content

Commit

Permalink
fix: bench (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
byte-sourcerer authored Sep 17, 2024
1 parent 28bc02b commit c4966d7
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions benches/benches_against_rocksdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,24 +111,27 @@ fn bench<D: Database>(c: &mut Criterion, name: &str, build_db: impl Fn(&TempDir)
b.iter(|| iterate(db.clone(), KEY_NUMS, CHUNK_SIZE, SMALL_VALUE_SIZE));
});

c.bench_function("rocks sequentially populate large value", |b| {
let dir = tempfile::Builder::new()
.prefix(&format!("{}-bench-seq-populate-large-value", name))
.tempdir()
.unwrap();
let db = build_db(&dir);
c.bench_function(
&format!("{} sequentially populate large value", name),
|b| {
let dir = tempfile::Builder::new()
.prefix(&format!("{}-bench-seq-populate-large-value", name))
.tempdir()
.unwrap();
let db = build_db(&dir);

b.iter(|| {
populate(
db.clone(),
KEY_NUMS,
CHUNK_SIZE,
BATCH_SIZE,
LARGE_VALUE_SIZE,
true,
);
});
});
b.iter(|| {
populate(
db.clone(),
KEY_NUMS,
CHUNK_SIZE,
BATCH_SIZE,
LARGE_VALUE_SIZE,
true,
);
});
},
);

c.bench_function(&format!("{} randomly populate large value", name), |b| {
let dir = tempfile::Builder::new()
Expand Down

0 comments on commit c4966d7

Please sign in to comment.