From 4f5833c681257bc674a7770df920daa6bfa063ef Mon Sep 17 00:00:00 2001 From: Pere Diaz Bou Date: Thu, 18 Sep 2025 18:40:13 +0200 Subject: [PATCH] fmt --- core/benches/benchmark.rs | 113 +++++---------------------------- core/benches/json_benchmark.rs | 16 +---- 2 files changed, 17 insertions(+), 112 deletions(-) diff --git a/core/benches/benchmark.rs b/core/benches/benchmark.rs index e400df5be..51b844aad 100644 --- a/core/benches/benchmark.rs +++ b/core/benches/benchmark.rs @@ -24,13 +24,7 @@ fn bench_open(criterion: &mut Criterion) { if !std::fs::exists("../testing/schema_5k.db").unwrap() { #[allow(clippy::arc_with_non_send_sync)] let io = Arc::new(PlatformIO::new().unwrap()); - let db = Database::open_file( - io.clone(), - "../testing/schema_5k.db", - false, - false, - ) - .unwrap(); + let db = Database::open_file(io.clone(), "../testing/schema_5k.db", false, false).unwrap(); let conn = db.connect().unwrap(); for i in 0..5000 { @@ -46,13 +40,8 @@ fn bench_open(criterion: &mut Criterion) { b.iter(|| { #[allow(clippy::arc_with_non_send_sync)] let io = Arc::new(PlatformIO::new().unwrap()); - let db = Database::open_file( - io.clone(), - "../testing/schema_5k.db", - false, - false, - ) - .unwrap(); + let db = + Database::open_file(io.clone(), "../testing/schema_5k.db", false, false).unwrap(); let conn = db.connect().unwrap(); conn.execute("SELECT * FROM table_0").unwrap(); }); @@ -78,13 +67,7 @@ fn bench_alter(criterion: &mut Criterion) { if !std::fs::exists("../testing/schema_5k.db").unwrap() { #[allow(clippy::arc_with_non_send_sync)] let io = Arc::new(PlatformIO::new().unwrap()); - let db = Database::open_file( - io.clone(), - "../testing/schema_5k.db", - false, - false, - ) - .unwrap(); + let db = Database::open_file(io.clone(), "../testing/schema_5k.db", false, false).unwrap(); let conn = db.connect().unwrap(); for i in 0..5000 { @@ -99,13 +82,7 @@ fn bench_alter(criterion: &mut Criterion) { group.bench_function(BenchmarkId::new("limbo_rename_table", ""), |b| { #[allow(clippy::arc_with_non_send_sync)] let io = Arc::new(PlatformIO::new().unwrap()); - let db = Database::open_file( - io.clone(), - "../testing/schema_5k.db", - false, - false, - ) - .unwrap(); + let db = Database::open_file(io.clone(), "../testing/schema_5k.db", false, false).unwrap(); let conn = db.connect().unwrap(); b.iter_custom(|iters| { (0..iters) @@ -150,13 +127,7 @@ fn bench_alter(criterion: &mut Criterion) { group.bench_function(BenchmarkId::new("limbo_rename_column", ""), |b| { #[allow(clippy::arc_with_non_send_sync)] let io = Arc::new(PlatformIO::new().unwrap()); - let db = Database::open_file( - io.clone(), - "../testing/schema_5k.db", - false, - false, - ) - .unwrap(); + let db = Database::open_file(io.clone(), "../testing/schema_5k.db", false, false).unwrap(); let conn = db.connect().unwrap(); b.iter_custom(|iters| { (0..iters) @@ -202,13 +173,7 @@ fn bench_alter(criterion: &mut Criterion) { group.bench_function(BenchmarkId::new("limbo_add_column", ""), |b| { #[allow(clippy::arc_with_non_send_sync)] let io = Arc::new(PlatformIO::new().unwrap()); - let db = Database::open_file( - io.clone(), - "../testing/schema_5k.db", - false, - false, - ) - .unwrap(); + let db = Database::open_file(io.clone(), "../testing/schema_5k.db", false, false).unwrap(); let conn = db.connect().unwrap(); b.iter_custom(|iters| { (0..iters) @@ -253,13 +218,7 @@ fn bench_alter(criterion: &mut Criterion) { group.bench_function(BenchmarkId::new("limbo_drop_column", ""), |b| { #[allow(clippy::arc_with_non_send_sync)] let io = Arc::new(PlatformIO::new().unwrap()); - let db = Database::open_file( - io.clone(), - "../testing/schema_5k.db", - false, - false, - ) - .unwrap(); + let db = Database::open_file(io.clone(), "../testing/schema_5k.db", false, false).unwrap(); let conn = db.connect().unwrap(); b.iter_custom(|iters| { (0..iters) @@ -307,13 +266,7 @@ fn bench_prepare_query(criterion: &mut Criterion) { #[allow(clippy::arc_with_non_send_sync)] let io = Arc::new(PlatformIO::new().unwrap()); - let db = Database::open_file( - io.clone(), - "../testing/testing.db", - false, - false, - ) - .unwrap(); + let db = Database::open_file(io.clone(), "../testing/testing.db", false, false).unwrap(); let limbo_conn = db.connect().unwrap(); let queries = [ @@ -392,13 +345,7 @@ fn bench_execute_select_rows(criterion: &mut Criterion) { #[allow(clippy::arc_with_non_send_sync)] let io = Arc::new(PlatformIO::new().unwrap()); - let db = Database::open_file( - io.clone(), - "../testing/testing.db", - false, - false, - ) - .unwrap(); + let db = Database::open_file(io.clone(), "../testing/testing.db", false, false).unwrap(); let limbo_conn = db.connect().unwrap(); let mut group = criterion.benchmark_group("Execute `SELECT * FROM users LIMIT ?`"); @@ -466,13 +413,7 @@ fn bench_execute_select_1(criterion: &mut Criterion) { #[allow(clippy::arc_with_non_send_sync)] let io = Arc::new(PlatformIO::new().unwrap()); - let db = Database::open_file( - io.clone(), - "../testing/testing.db", - false, - false, - ) - .unwrap(); + let db = Database::open_file(io.clone(), "../testing/testing.db", false, false).unwrap(); let limbo_conn = db.connect().unwrap(); let mut group = criterion.benchmark_group("Execute `SELECT 1`"); @@ -524,13 +465,7 @@ fn bench_execute_select_count(criterion: &mut Criterion) { #[allow(clippy::arc_with_non_send_sync)] let io = Arc::new(PlatformIO::new().unwrap()); - let db = Database::open_file( - io.clone(), - "../testing/testing.db", - false, - false, - ) - .unwrap(); + let db = Database::open_file(io.clone(), "../testing/testing.db", false, false).unwrap(); let limbo_conn = db.connect().unwrap(); let mut group = criterion.benchmark_group("Execute `SELECT count() FROM users`"); @@ -588,13 +523,7 @@ fn bench_insert_rows(criterion: &mut Criterion) { #[allow(clippy::arc_with_non_send_sync)] let io = Arc::new(PlatformIO::new().unwrap()); - let db = Database::open_file( - io.clone(), - db_path.to_str().unwrap(), - false, - false, - ) - .unwrap(); + let db = Database::open_file(io.clone(), db_path.to_str().unwrap(), false, false).unwrap(); let limbo_conn = db.connect().unwrap(); let mut stmt = limbo_conn @@ -718,13 +647,7 @@ fn bench_limbo( let io = Arc::new(PlatformIO::new().unwrap()); let temp_dir = tempfile::tempdir().unwrap(); let path = temp_dir.path().join("bench.db"); - let db = Database::open_file( - io.clone(), - path.to_str().unwrap(), - mvcc, - false, - ) - .unwrap(); + let db = Database::open_file(io.clone(), path.to_str().unwrap(), mvcc, false).unwrap(); let mut connecitons = Vec::new(); { let conn = db.connect().unwrap(); @@ -807,13 +730,7 @@ fn bench_limbo_mvcc( let io = Arc::new(PlatformIO::new().unwrap()); let temp_dir = tempfile::tempdir().unwrap(); let path = temp_dir.path().join("bench.db"); - let db = Database::open_file( - io.clone(), - path.to_str().unwrap(), - mvcc, - false, - ) - .unwrap(); + let db = Database::open_file(io.clone(), path.to_str().unwrap(), mvcc, false).unwrap(); let mut connecitons = Vec::new(); let conn0 = db.connect().unwrap(); conn0.execute("CREATE TABLE test (x)").unwrap(); diff --git a/core/benches/json_benchmark.rs b/core/benches/json_benchmark.rs index 811f1e4dd..a6f63ceb4 100644 --- a/core/benches/json_benchmark.rs +++ b/core/benches/json_benchmark.rs @@ -490,13 +490,7 @@ fn bench_sequential_jsonb(criterion: &mut Criterion) { #[allow(clippy::arc_with_non_send_sync)] let io = Arc::new(PlatformIO::new().unwrap()); - let db = Database::open_file( - io.clone(), - "../testing/testing.db", - false, - false, - ) - .unwrap(); + let db = Database::open_file(io.clone(), "../testing/testing.db", false, false).unwrap(); let limbo_conn = db.connect().unwrap(); // Select a subset of JSON payloads to use in the sequential test @@ -652,13 +646,7 @@ fn bench_json_patch(criterion: &mut Criterion) { #[allow(clippy::arc_with_non_send_sync)] let io = Arc::new(PlatformIO::new().unwrap()); - let db = Database::open_file( - io.clone(), - "../testing/testing.db", - false, - false, - ) - .unwrap(); + let db = Database::open_file(io.clone(), "../testing/testing.db", false, false).unwrap(); let limbo_conn = db.connect().unwrap(); let json_patch_cases = [