mirror of
https://github.com/isar/rusqlite.git
synced 2025-08-19 12:29:34 +08:00
Benchmark execute vs execute_batch
This commit is contained in:
17
benches/exec.rs
Normal file
17
benches/exec.rs
Normal file
@@ -0,0 +1,17 @@
|
||||
use bencher::{benchmark_group, benchmark_main, Bencher};
|
||||
use rusqlite::{Connection, NO_PARAMS};
|
||||
|
||||
fn bench_execute(b: &mut Bencher) {
|
||||
let db = Connection::open_in_memory().unwrap();
|
||||
let sql = "PRAGMA user_version=1";
|
||||
b.iter(|| db.execute(sql, NO_PARAMS).unwrap());
|
||||
}
|
||||
|
||||
fn bench_execute_batch(b: &mut Bencher) {
|
||||
let db = Connection::open_in_memory().unwrap();
|
||||
let sql = "PRAGMA user_version=1";
|
||||
b.iter(|| db.execute_batch(sql).unwrap());
|
||||
}
|
||||
|
||||
benchmark_group!(exec_benches, bench_execute, bench_execute_batch);
|
||||
benchmark_main!(exec_benches);
|
Reference in New Issue
Block a user