mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-27 21:14:21 +01:00
Merge 'perf/throughput: Use connection per transaction in rusqlite benchmark' from Pekka Enberg
Open a connection per transaction in the rusqlite benchmark so that we're comparing the same workload with Turso. Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com> Closes #3816
This commit is contained in:
@@ -115,18 +115,18 @@ fn worker_thread(
|
||||
start_barrier: Arc<Barrier>,
|
||||
compute_usec: u64,
|
||||
) -> Result<u64> {
|
||||
let conn = Connection::open(&db_path)?;
|
||||
|
||||
conn.pragma_update(None, "synchronous", "FULL")?;
|
||||
conn.pragma_update(None, "fullfsync", "true")?;
|
||||
|
||||
conn.busy_timeout(std::time::Duration::from_secs(30))?;
|
||||
|
||||
start_barrier.wait();
|
||||
|
||||
let mut total_inserts = 0;
|
||||
|
||||
for iteration in 0..iterations {
|
||||
let conn = Connection::open(&db_path)?;
|
||||
|
||||
conn.pragma_update(None, "synchronous", "FULL")?;
|
||||
conn.pragma_update(None, "fullfsync", "true")?;
|
||||
|
||||
conn.busy_timeout(std::time::Duration::from_secs(30))?;
|
||||
|
||||
let mut stmt = conn.prepare("INSERT INTO test_table (id, data) VALUES (?, ?)")?;
|
||||
|
||||
conn.execute("BEGIN", [])?;
|
||||
|
||||
Reference in New Issue
Block a user