Skip to content
This repository has been archived by the owner on Aug 4, 2024. It is now read-only.

Commit

Permalink
fix: merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
KKould committed Sep 10, 2023
2 parents 308f643 + 596a90c commit 831447d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
28 changes: 14 additions & 14 deletions src/bench/kernel_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ fn random(n: u32) -> u32 {
}

fn bulk_load<T: Storage>(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<u8> {
count
Expand All @@ -62,8 +57,14 @@ fn bulk_load<T: Storage>(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()
});
Expand All @@ -83,12 +84,10 @@ fn bulk_load<T: Storage>(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);
}
Expand All @@ -97,11 +96,12 @@ fn bulk_load<T: Storage>(c: &mut Criterion) {

fn monotonic_crud<T: Storage>(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();

Expand Down Expand Up @@ -141,13 +141,12 @@ fn random_crud<T: Storage>(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 {
Expand All @@ -173,6 +172,7 @@ fn random_crud<T: Storage>(c: &mut Criterion) {

fn empty_opens<T: Storage>(c: &mut Criterion) {
let rt = tokio::runtime::Builder::new_multi_thread()
.worker_threads(8)
.enable_all()
.build()
.unwrap();
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/lsm/compactor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 831447d

Please sign in to comment.