mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-22 10:07:40 +08:00
Avoid reallocation with the ThreadLocal pool
This commit is contained in:
parent
83c09d0db0
commit
eb09dfed04
@ -211,7 +211,7 @@ impl DocidsExtractor for FacetedDocidsExtractor {
|
|||||||
let attributes_to_extract = Self::attributes_to_extract(&rtxn, index)?;
|
let attributes_to_extract = Self::attributes_to_extract(&rtxn, index)?;
|
||||||
let attributes_to_extract: Vec<_> =
|
let attributes_to_extract: Vec<_> =
|
||||||
attributes_to_extract.iter().map(|s| s.as_ref()).collect();
|
attributes_to_extract.iter().map(|s| s.as_ref()).collect();
|
||||||
let thread_local = ThreadLocal::new();
|
let thread_local = ThreadLocal::with_capacity(rayon::current_num_threads());
|
||||||
|
|
||||||
{
|
{
|
||||||
let span =
|
let span =
|
||||||
|
@ -342,7 +342,7 @@ impl WordDocidsExtractors {
|
|||||||
max_positions_per_attributes: MAX_POSITION_PER_ATTRIBUTE,
|
max_positions_per_attributes: MAX_POSITION_PER_ATTRIBUTE,
|
||||||
};
|
};
|
||||||
|
|
||||||
let thread_local = ThreadLocal::new();
|
let thread_local = ThreadLocal::with_capacity(rayon::current_num_threads());
|
||||||
|
|
||||||
{
|
{
|
||||||
let span =
|
let span =
|
||||||
|
@ -60,7 +60,7 @@ pub trait SearchableExtractor {
|
|||||||
max_positions_per_attributes: MAX_POSITION_PER_ATTRIBUTE,
|
max_positions_per_attributes: MAX_POSITION_PER_ATTRIBUTE,
|
||||||
};
|
};
|
||||||
|
|
||||||
let thread_local = ThreadLocal::new();
|
let thread_local = ThreadLocal::with_capacity(rayon::current_num_threads());
|
||||||
|
|
||||||
{
|
{
|
||||||
let span =
|
let span =
|
||||||
|
Loading…
Reference in New Issue
Block a user