mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-22 16:29:20 +08:00
Disable benches by default
This commit is contained in:
parent
8ddacbb27c
commit
0edc91e8ef
@ -56,6 +56,7 @@ series = ["vtab"]
|
|||||||
# check for invalid query.
|
# check for invalid query.
|
||||||
extra_check = []
|
extra_check = []
|
||||||
modern_sqlite = ["libsqlite3-sys/bundled_bindings"]
|
modern_sqlite = ["libsqlite3-sys/bundled_bindings"]
|
||||||
|
unstable = []
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
time = "0.1.0"
|
time = "0.1.0"
|
||||||
|
@ -1,20 +1,24 @@
|
|||||||
#![feature(test)]
|
#![cfg_attr(feature = "unstable", feature(test))]
|
||||||
extern crate test;
|
|
||||||
|
|
||||||
use rusqlite::Connection;
|
#[cfg(feature = "unstable")]
|
||||||
use test::Bencher;
|
mod bench {
|
||||||
|
extern crate test;
|
||||||
|
|
||||||
#[bench]
|
use rusqlite::Connection;
|
||||||
fn bench_no_cache(b: &mut Bencher) {
|
use test::Bencher;
|
||||||
let db = Connection::open_in_memory().unwrap();
|
|
||||||
db.set_prepared_statement_cache_capacity(0);
|
#[bench]
|
||||||
let sql = "SELECT 1, 'test', 3.14 UNION SELECT 2, 'exp', 2.71";
|
fn bench_no_cache(b: &mut Bencher) {
|
||||||
b.iter(|| db.prepare(sql).unwrap());
|
let db = Connection::open_in_memory().unwrap();
|
||||||
}
|
db.set_prepared_statement_cache_capacity(0);
|
||||||
|
let sql = "SELECT 1, 'test', 3.14 UNION SELECT 2, 'exp', 2.71";
|
||||||
#[bench]
|
b.iter(|| db.prepare(sql).unwrap());
|
||||||
fn bench_cache(b: &mut Bencher) {
|
}
|
||||||
let db = Connection::open_in_memory().unwrap();
|
|
||||||
let sql = "SELECT 1, 'test', 3.14 UNION SELECT 2, 'exp', 2.71";
|
#[bench]
|
||||||
b.iter(|| db.prepare_cached(sql).unwrap());
|
fn bench_cache(b: &mut Bencher) {
|
||||||
|
let db = Connection::open_in_memory().unwrap();
|
||||||
|
let sql = "SELECT 1, 'test', 3.14 UNION SELECT 2, 'exp', 2.71";
|
||||||
|
b.iter(|| db.prepare_cached(sql).unwrap());
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user