summaryrefslogtreecommitdiffstats
path: root/third_party/rust/rusqlite/benches/exec.rs
blob: b95cb354eee7ea493db6b1b9b0a719973c6e09d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use bencher::{benchmark_group, benchmark_main, Bencher};
use rusqlite::Connection;

fn bench_execute(b: &mut Bencher) {
    let db = Connection::open_in_memory().unwrap();
    let sql = "PRAGMA user_version=1";
    b.iter(|| db.execute(sql, []).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);