mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-23 02:27:40 +08:00
Always sort internal Sorter entries in parallel
This commit is contained in:
parent
b10c060bf7
commit
4d864f0702
@ -47,6 +47,7 @@ pub fn create_sorter(
|
||||
builder.allow_realloc(false);
|
||||
}
|
||||
builder.sort_algorithm(sort_algorithm);
|
||||
builder.sort_in_parallel(true);
|
||||
builder.build()
|
||||
}
|
||||
|
||||
|
@ -114,43 +114,24 @@ impl<'a, 'i> Transform<'a, 'i> {
|
||||
};
|
||||
|
||||
// We initialize the sorter with the user indexing settings.
|
||||
let original_sorter = {
|
||||
let mut builder = grenad::Sorter::builder(merge_function);
|
||||
builder.chunk_compression_type(indexer_settings.chunk_compression_type);
|
||||
if let Some(level) = indexer_settings.chunk_compression_level {
|
||||
builder.chunk_compression_level(level);
|
||||
}
|
||||
if let Some(nb_chunks) = indexer_settings.max_nb_chunks {
|
||||
builder.max_nb_chunks(nb_chunks);
|
||||
}
|
||||
if let Some(memory) = indexer_settings.max_memory.map(|mem| mem / 2) {
|
||||
builder.dump_threshold(memory);
|
||||
builder.allow_realloc(false);
|
||||
}
|
||||
builder.sort_algorithm(grenad::SortAlgorithm::Stable);
|
||||
builder.sort_in_parallel(true);
|
||||
builder.build()
|
||||
};
|
||||
let original_sorter = create_sorter(
|
||||
grenad::SortAlgorithm::Stable,
|
||||
merge_function,
|
||||
indexer_settings.chunk_compression_type,
|
||||
indexer_settings.chunk_compression_level,
|
||||
indexer_settings.max_nb_chunks,
|
||||
indexer_settings.max_memory.map(|mem| mem / 2),
|
||||
);
|
||||
|
||||
// We initialize the sorter with the user indexing settings.
|
||||
let flattened_sorter = {
|
||||
let mut builder = grenad::Sorter::builder(merge_function);
|
||||
builder.chunk_compression_type(indexer_settings.chunk_compression_type);
|
||||
if let Some(level) = indexer_settings.chunk_compression_level {
|
||||
builder.chunk_compression_level(level);
|
||||
}
|
||||
if let Some(nb_chunks) = indexer_settings.max_nb_chunks {
|
||||
builder.max_nb_chunks(nb_chunks);
|
||||
}
|
||||
if let Some(memory) = indexer_settings.max_memory.map(|mem| mem / 2) {
|
||||
builder.dump_threshold(memory);
|
||||
builder.allow_realloc(false);
|
||||
}
|
||||
builder.sort_algorithm(grenad::SortAlgorithm::Stable);
|
||||
builder.sort_in_parallel(true);
|
||||
builder.build()
|
||||
};
|
||||
|
||||
let flattened_sorter = create_sorter(
|
||||
grenad::SortAlgorithm::Stable,
|
||||
merge_function,
|
||||
indexer_settings.chunk_compression_type,
|
||||
indexer_settings.chunk_compression_level,
|
||||
indexer_settings.max_nb_chunks,
|
||||
indexer_settings.max_memory.map(|mem| mem / 2),
|
||||
);
|
||||
let documents_ids = index.documents_ids(wtxn)?;
|
||||
|
||||
Ok(Transform {
|
||||
|
Loading…
Reference in New Issue
Block a user