mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-25 03:25:06 +08:00
Add spans
This commit is contained in:
parent
d6b3aae8a6
commit
bdd363dd94
@ -8,7 +8,7 @@ use std::mem;
|
|||||||
|
|
||||||
pub use faceted::*;
|
pub use faceted::*;
|
||||||
use grenad::MergeFunction;
|
use grenad::MergeFunction;
|
||||||
use rayon::iter::IntoParallelIterator;
|
use rayon::iter::{IntoParallelIterator, ParallelIterator as _};
|
||||||
use rayon::slice::ParallelSliceMut as _;
|
use rayon::slice::ParallelSliceMut as _;
|
||||||
pub use searchable::*;
|
pub use searchable::*;
|
||||||
use smallvec::SmallVec;
|
use smallvec::SmallVec;
|
||||||
@ -50,8 +50,18 @@ impl IntoIterator for HashMapMerger {
|
|||||||
type IntoIter = IntoIter;
|
type IntoIter = IntoIter;
|
||||||
|
|
||||||
fn into_iter(self) -> Self::IntoIter {
|
fn into_iter(self) -> Self::IntoIter {
|
||||||
let mut entries: Vec<_> = self.maps.into_iter().flat_map(|m| m.into_iter()).collect();
|
let mut entries = {
|
||||||
|
let span = tracing::trace_span!(target: "indexing::documents::merge", "into_par_iter");
|
||||||
|
let _entered = span.enter();
|
||||||
|
let entries: Vec<_> =
|
||||||
|
self.maps.into_par_iter().flat_map(|m| m.into_par_iter()).collect();
|
||||||
eprintln!("There are {} entries in the HashMapMerger", entries.len());
|
eprintln!("There are {} entries in the HashMapMerger", entries.len());
|
||||||
|
entries
|
||||||
|
};
|
||||||
|
{
|
||||||
|
let span =
|
||||||
|
tracing::trace_span!(target: "indexing::documents::merge", "par_sort_unstable_by");
|
||||||
|
let _entered = span.enter();
|
||||||
entries.par_sort_unstable_by(|(ka, _), (kb, _)| ka.cmp(kb));
|
entries.par_sort_unstable_by(|(ka, _), (kb, _)| ka.cmp(kb));
|
||||||
IntoIter {
|
IntoIter {
|
||||||
sorted_entries: entries.into_iter(),
|
sorted_entries: entries.into_iter(),
|
||||||
@ -60,6 +70,7 @@ impl IntoIterator for HashMapMerger {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub struct IntoIter {
|
pub struct IntoIter {
|
||||||
sorted_entries: std::vec::IntoIter<(SmallVec<[u8; 12]>, cache::DelAddRoaringBitmap)>,
|
sorted_entries: std::vec::IntoIter<(SmallVec<[u8; 12]>, cache::DelAddRoaringBitmap)>,
|
||||||
|
Loading…
Reference in New Issue
Block a user