Merge 'measure only the time it takes to open the actual connection' from Glauber Costa

The current code includes creating the database object, which is slow.
Unfortunately the same cannot be done on the standard SQLite.

Reviewed-by: Preston Thorpe (@PThorpe92)

Closes #2242
This commit is contained in:
Jussi Saurio
2025-07-24 10:09:00 +03:00

View File

@@ -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();