mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-29 16:45:30 +08:00
Merge pull request #87 from Kerollmops/measure-index-loading
Display index loading times
This commit is contained in:
commit
fbc698567a
@ -39,10 +39,18 @@ where D: Deref<Target=DB>
|
||||
fn retrieve_data_index<D>(snapshot: &Snapshot<D>) -> Result<Index, Box<Error>>
|
||||
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) => {
|
||||
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(),
|
||||
};
|
||||
|
@ -162,7 +162,6 @@ where D: Deref<Target=DB>,
|
||||
let (elapsed, ()) = elapsed::measure_time(|| {
|
||||
group.sort_unstable_by(|a, b| criterion.evaluate(a, b, view));
|
||||
});
|
||||
|
||||
info!("criterion {} sort took {}", ci, elapsed);
|
||||
|
||||
for group in BinaryGroupByMut::new(group, |a, b| criterion.eq(a, b, view)) {
|
||||
|
Loading…
Reference in New Issue
Block a user