mirror of
				https://github.com/meilisearch/meilisearch.git
				synced 2025-11-04 09:56:28 +00:00 
			
		
		
		
	Avoid reallocation with the ThreadLocal pool
This commit is contained in:
		@@ -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 =
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user