diff --git a/src/bench/kernel_bench.rs b/src/bench/kernel_bench.rs index 6ec5c47..c8b324f 100644 --- a/src/bench/kernel_bench.rs +++ b/src/bench/kernel_bench.rs @@ -45,11 +45,6 @@ fn random(n: u32) -> u32 { } fn bulk_load(c: &mut Criterion) { - let rt = tokio::runtime::Builder::new_multi_thread() - .enable_all() - .build() - .unwrap(); - let count = AtomicU32::new(0_u32); let bytes = |len| -> Vec { count @@ -62,8 +57,14 @@ fn bulk_load(c: &mut Criterion) { }; let mut bench = |key_len, val_len| { + let rt = tokio::runtime::Builder::new_multi_thread() + .worker_threads(8) + .enable_all() + .build() + .unwrap(); + let db = rt.block_on(async { - T::open(format!("{}: bulk_k{}_v{}", T::name(), key_len, val_len)) + T::open(format!("{}_bulk_k{}_v{}", T::name(), key_len, val_len)) .await .unwrap() }); @@ -83,12 +84,10 @@ fn bulk_load(c: &mut Criterion) { }) }, ); - rt.block_on(async { - db.flush().await.unwrap(); - }); + rt.shutdown_background(); }; - for key_len in &[10_usize, 128, 256, 512] { + for key_len in &[10_usize, 128, 512] { for val_len in &[0_usize, 10, 128, 256, 512, 1024, 2048] { bench(*key_len, *val_len); } @@ -97,11 +96,12 @@ fn bulk_load(c: &mut Criterion) { fn monotonic_crud(c: &mut Criterion) { let rt = tokio::runtime::Builder::new_multi_thread() + .worker_threads(8) .enable_all() .build() .unwrap(); rt.block_on(async { - let db = T::open(format!("{}: monotonic_crud", T::name())) + let db = T::open(format!("{}_monotonic_crud", T::name())) .await .unwrap(); @@ -141,13 +141,12 @@ fn random_crud(c: &mut Criterion) { const SIZE: u32 = 65536; let rt = tokio::runtime::Builder::new_multi_thread() + .worker_threads(8) .enable_all() .build() .unwrap(); rt.block_on(async { - let db = T::open(format!("{}: random_crud", T::name())) - .await - .unwrap(); + let db = T::open(format!("{}_random_crud", T::name())).await.unwrap(); c.bench_function(&format!("Store: {}, random inserts", T::name()), |b| { b.iter(|| async { @@ -173,6 +172,7 @@ fn random_crud(c: &mut Criterion) { fn empty_opens(c: &mut Criterion) { let rt = tokio::runtime::Builder::new_multi_thread() + .worker_threads(8) .enable_all() .build() .unwrap(); diff --git a/src/kernel/lsm/compactor.rs b/src/kernel/lsm/compactor.rs index 43eb9ce..e27cd36 100644 --- a/src/kernel/lsm/compactor.rs +++ b/src/kernel/lsm/compactor.rs @@ -278,7 +278,7 @@ impl Compactor { { let mut iter = table.iter()?; let mut vec_cmd = Vec::with_capacity(table.len()); - while let Some(item) = iter.try_next()? { + while let Some(item) = iter.next_err()? { if fn_is_filter(&item.0) { vec_cmd.push(item) }