From 5a66ed8433f7f9bd5a15e03014ec3271357bf984 Mon Sep 17 00:00:00 2001 From: Glauber Costa Date: Wed, 23 Jul 2025 08:41:36 -0500 Subject: [PATCH] measure only the time it takes to open the actual connection The current code includes creating the database object, which is slow. Unfortunately the same cannot be done on the standard SQLite. --- perf/connection/limbo/src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/perf/connection/limbo/src/main.rs b/perf/connection/limbo/src/main.rs index fb4632b5b..f046c586c 100644 --- a/perf/connection/limbo/src/main.rs +++ b/perf/connection/limbo/src/main.rs @@ -21,11 +21,12 @@ fn main() { println!("Testing connection performance with database: {}", opts.database); + // Open the database object. + let db = Database::open_file(io.clone(), &opts.database, false, false).unwrap(); for i in 0..opts.iterations { let start = Instant::now(); - // Open connection to database and prepare a statement - let db = Database::open_file(io.clone(), &opts.database, false, false).unwrap(); + // now open a new connection and prepare a statement. let conn = db.connect().unwrap(); let _stmt = conn.prepare("SELECT name FROM table_0 WHERE id = ?").unwrap();