1 use bencher::{benchmark_group, benchmark_main, Bencher}; 2 use rusqlite::Connection; 3 bench_execute(b: &mut Bencher)4fn bench_execute(b: &mut Bencher) { 5 let db = Connection::open_in_memory().unwrap(); 6 let sql = "PRAGMA user_version=1"; 7 b.iter(|| db.execute(sql, []).unwrap()); 8 } 9 bench_execute_batch(b: &mut Bencher)10fn bench_execute_batch(b: &mut Bencher) { 11 let db = Connection::open_in_memory().unwrap(); 12 let sql = "PRAGMA user_version=1"; 13 b.iter(|| db.execute_batch(sql).unwrap()); 14 } 15 16 benchmark_group!(exec_benches, bench_execute, bench_execute_batch); 17 benchmark_main!(exec_benches); 18