chore: Display index loading times

This commit is contained in:
Clément Renault 2019-01-23 11:19:44 +01:00
parent 61e83a1c21
commit aa9db14c09
No known key found for this signature in database
GPG Key ID: 0151CDAB43460DAE
2 changed files with 10 additions and 3 deletions

View File

@ -39,10 +39,18 @@ where D: Deref<Target=DB>
fn retrieve_data_index<D>(snapshot: &Snapshot<D>) -> Result<Index, Box<Error>> fn retrieve_data_index<D>(snapshot: &Snapshot<D>) -> Result<Index, Box<Error>>
where D: Deref<Target=DB> where D: Deref<Target=DB>
{ {
let index = match snapshot.get(DATA_INDEX)? { let (elapsed, vector) = elapsed::measure_time(|| snapshot.get(DATA_INDEX));
info!("loading index from kv-store took {}", elapsed);
let index = match vector? {
Some(vector) => { Some(vector) => {
let bytes = vector.as_ref().to_vec(); let bytes = vector.as_ref().to_vec();
Index::from_bytes(bytes)? info!("index size if {} MiB", bytes.len() / 1024 / 1024);
let (elapsed, index) = elapsed::measure_time(|| Index::from_bytes(bytes));
info!("loading index from bytes took {}", elapsed);
index?
}, },
None => Index::default(), None => Index::default(),
}; };

View File

@ -162,7 +162,6 @@ where D: Deref<Target=DB>,
let (elapsed, ()) = elapsed::measure_time(|| { let (elapsed, ()) = elapsed::measure_time(|| {
group.sort_unstable_by(|a, b| criterion.evaluate(a, b, view)); group.sort_unstable_by(|a, b| criterion.evaluate(a, b, view));
}); });
info!("criterion {} sort took {}", ci, elapsed); info!("criterion {} sort took {}", ci, elapsed);
for group in BinaryGroupByMut::new(group, |a, b| criterion.eq(a, b, view)) { for group in BinaryGroupByMut::new(group, |a, b| criterion.eq(a, b, view)) {