mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-23 10:37:41 +08:00
chore: Display index loading times
This commit is contained in:
parent
61e83a1c21
commit
aa9db14c09
@ -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(),
|
||||||
};
|
};
|
||||||
|
@ -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)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user