mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-30 08:44:27 +01: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: Vec<_> =
|
||||
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 =
|
||||
|
@ -342,7 +342,7 @@ impl WordDocidsExtractors {
|
||||
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 =
|
||||
|
@ -60,7 +60,7 @@ pub trait SearchableExtractor {
|
||||
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 =
|
||||
|
Loading…
Reference in New Issue
Block a user