-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
set up for benching index in different dbs
- Loading branch information
Showing
2 changed files
with
56 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#![feature(test)] | ||
extern crate test; | ||
use test::Bencher; | ||
|
||
use hidefix::idx::Index; | ||
|
||
mod serde_sled { | ||
use super::*; | ||
|
||
#[ignore] | ||
#[bench] | ||
fn deserialize_meps_bincode_db_sled(b: &mut Bencher) { | ||
let i = Index::index("tests/data/meps_det_vc_2_5km_latest.nc").unwrap(); | ||
|
||
let bts = bincode::serialize(&i).unwrap(); | ||
|
||
let db = sled::Config::default() | ||
.temporary(true) | ||
.print_profile_on_drop(true) | ||
.open() | ||
.unwrap(); | ||
|
||
db.insert("meps", bts).unwrap(); | ||
|
||
b.iter(|| { | ||
let bts = db.get("meps").unwrap().unwrap(); | ||
test::black_box(bincode::deserialize::<Index>(&bts).unwrap()); | ||
}) | ||
} | ||
|
||
#[ignore] | ||
#[bench] | ||
fn deserialize_meps_bincode_db_sled_only_read(b: &mut Bencher) { | ||
let i = Index::index("tests/data/meps_det_vc_2_5km_latest.nc").unwrap(); | ||
|
||
let bts = bincode::serialize(&i).unwrap(); | ||
|
||
let db = sled::Config::default() | ||
.temporary(true) | ||
.print_profile_on_drop(true) | ||
.open() | ||
.unwrap(); | ||
|
||
db.insert("meps", bts).unwrap(); | ||
|
||
b.iter(|| { | ||
test::black_box(db.get("meps").unwrap().unwrap()); | ||
}) | ||
} | ||
} | ||
|
||
mod serde_sqlite { | ||
use super::*; | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters