2020-06-27 15:54:33 +08:00
|
|
|
use bencher::{benchmark_group, benchmark_main, Bencher};
|
2020-11-03 17:32:46 +08:00
|
|
|
use rusqlite::Connection;
|
2020-06-27 15:54:33 +08:00
|
|
|
|
|
|
|
fn bench_execute(b: &mut Bencher) {
|
|
|
|
let db = Connection::open_in_memory().unwrap();
|
|
|
|
let sql = "PRAGMA user_version=1";
|
2020-11-03 17:32:46 +08:00
|
|
|
b.iter(|| db.execute(sql, []).unwrap());
|
2020-06-27 15:54:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
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);
|