Skip to content
This repository was archived by the owner on Jul 3, 2023. It is now read-only.

Commit 90265a0

Browse files
committed
Fix sequential read benchmark.
1 parent aa1cf33 commit 90265a0

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

benches/persistence.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use rand::Rng;
1010
use zipf::ZipfDistribution;
1111

1212
/// What different sizes we should instantiate for the set.
13-
static BENCHMARK_INPUTS: [u64; 1] = [1 << 8];
13+
static BENCHMARK_INPUTS: [u64; 2] = [1 << 12, 1 << 24];
1414

1515
/// Generate a random sequence of operations
1616
///
@@ -81,8 +81,8 @@ fn bench_zset_cursor_seq_access(c: &mut Criterion) {
8181
for i in BENCHMARK_INPUTS.iter() {
8282
group.bench_with_input(BenchmarkId::new("Persistent", i), i, |b, i| {
8383
let persistent_zset = persistent_builder(*i);
84-
let mut cursor = persistent_zset.cursor();
8584
b.iter(|| {
85+
let mut cursor = persistent_zset.cursor();
8686
let mut idx = 0;
8787
while cursor.key_valid() {
8888
assert_eq!(*cursor.key(), idx);
@@ -94,8 +94,8 @@ fn bench_zset_cursor_seq_access(c: &mut Criterion) {
9494

9595
group.bench_with_input(BenchmarkId::new("DRAM", i), i, |b, i| {
9696
let dram_zset = dram_builder(*i);
97-
let mut cursor = dram_zset.cursor();
9897
b.iter(|| {
98+
let mut cursor = dram_zset.cursor();
9999
let mut idx = 0;
100100
while cursor.key_valid() {
101101
assert_eq!(*cursor.key(), idx);
@@ -159,9 +159,9 @@ fn bench_zset_cursor_seek_skewed(c: &mut Criterion) {
159159

160160
criterion_group!(
161161
benches,
162-
//bench_zset_builder,
163-
//bench_zset_cursor_seq_access,
164-
//bench_zset_cursor_seek_uniform,
162+
bench_zset_builder,
163+
bench_zset_cursor_seq_access,
164+
bench_zset_cursor_seek_uniform,
165165
bench_zset_cursor_seek_skewed,
166166
);
167167
criterion_main!(benches);

src/trace/ord/persistent/zset_batch.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ static DB_OPTS: Lazy<Options> = Lazy::new(|| {
3636
global_opts.create_if_missing(true);
3737
global_opts.set_compression_type(DBCompressionType::None);
3838
global_opts.set_row_cache(&cache);
39+
global_opts.set_max_open_files(9000);
3940
global_opts
4041
});
4142

0 commit comments

Comments
 (0)