From 3b5e11ad97caa99ab0de2bcc4876c0a4b584a73e Mon Sep 17 00:00:00 2001 From: Kould Date: Tue, 5 Nov 2024 16:35:21 +0800 Subject: [PATCH] chore: add lru_reader on read_bench --- benches/common.rs | 2 +- benches/read_bench.rs | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/benches/common.rs b/benches/common.rs index 28dc8769..ab613078 100644 --- a/benches/common.rs +++ b/benches/common.rs @@ -299,7 +299,7 @@ impl BenchDatabase for TonboFoyerBenchDataBase { Self: 'db; fn db_type_name() -> &'static str { - "tonbo" + "tonbo_foyer" } async fn write_transaction(&self) -> Self::W<'_> { diff --git a/benches/read_bench.rs b/benches/read_bench.rs index f2099453..8dd68d98 100644 --- a/benches/read_bench.rs +++ b/benches/read_bench.rs @@ -12,8 +12,8 @@ use tokio::{fs, io::AsyncWriteExt}; use crate::common::{ read_tbl, BenchDatabase, BenchReadTransaction, BenchReader, RedbBenchDatabase, - RocksdbBenchDatabase, SledBenchDatabase, TonboBenchDataBase, TonboS3BenchDataBase, ITERATIONS, - NUM_SCAN, READ_TIMES, + RocksdbBenchDatabase, SledBenchDatabase, TonboBenchDataBase, TonboFoyerBenchDataBase, + TonboS3BenchDataBase, ITERATIONS, NUM_SCAN, READ_TIMES, }; async fn benchmark( @@ -153,10 +153,13 @@ async fn main() { load::(&tbl_path, data_dir.join("tonbo")).await; load::(&tbl_path, data_dir.join("rocksdb")).await; + load::(&tbl_path, data_dir.join("tonbo_foyer")).await; load::(&tbl_path, data_dir.join("tonbo_s3")).await; } let tonbo_latency_results = { benchmark::(data_dir.join("tonbo")).await }; + let tonbo_foyer_latency_results = + { benchmark::(data_dir.join("tonbo_foyer")).await }; let rocksdb_results = { benchmark::(data_dir.join("rocksdb")).await }; let tonbo_s3_latency_results = { benchmark::(data_dir.join("tonbo_s3")).await }; @@ -169,6 +172,7 @@ async fn main() { for results in [ tonbo_latency_results, + tonbo_foyer_latency_results, rocksdb_results, tonbo_s3_latency_results, ] { @@ -179,7 +183,7 @@ async fn main() { let mut table = comfy_table::Table::new(); table.set_width(100); - table.set_header(["", "tonbo", "rocksdb", "tonbo_s3"]); + table.set_header(["", "tonbo", "tonbo_foyer", "rocksdb", "tonbo_s3"]); for row in rows { table.add_row(row); }