Skip to content

Commit

Permalink
chore: add lru_reader on read_bench
Browse files Browse the repository at this point in the history
  • Loading branch information
KKould committed Nov 5, 2024
1 parent 5a27922 commit 3b5e11a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion benches/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<'_> {
Expand Down
10 changes: 7 additions & 3 deletions benches/read_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T: BenchDatabase + Send + Sync>(
Expand Down Expand Up @@ -153,10 +153,13 @@ async fn main() {

load::<TonboBenchDataBase>(&tbl_path, data_dir.join("tonbo")).await;
load::<RocksdbBenchDatabase>(&tbl_path, data_dir.join("rocksdb")).await;
load::<TonboFoyerBenchDataBase>(&tbl_path, data_dir.join("tonbo_foyer")).await;
load::<TonboS3BenchDataBase>(&tbl_path, data_dir.join("tonbo_s3")).await;
}

let tonbo_latency_results = { benchmark::<TonboBenchDataBase>(data_dir.join("tonbo")).await };
let tonbo_foyer_latency_results =
{ benchmark::<TonboFoyerBenchDataBase>(data_dir.join("tonbo_foyer")).await };
let rocksdb_results = { benchmark::<RocksdbBenchDatabase>(data_dir.join("rocksdb")).await };
let tonbo_s3_latency_results =
{ benchmark::<TonboS3BenchDataBase>(data_dir.join("tonbo_s3")).await };
Expand All @@ -169,6 +172,7 @@ async fn main() {

for results in [
tonbo_latency_results,
tonbo_foyer_latency_results,
rocksdb_results,
tonbo_s3_latency_results,
] {
Expand All @@ -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);
}
Expand Down

0 comments on commit 3b5e11a

Please sign in to comment.