From 5e12a83ae8496a46f6b2df5199f372cef4861f76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Tue, 12 Nov 2024 10:53:50 +0100 Subject: [PATCH] Add some comments --- crates/milli/src/update/new/indexer/document_operation.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/milli/src/update/new/indexer/document_operation.rs b/crates/milli/src/update/new/indexer/document_operation.rs index 3be6cc080..7beffc7fc 100644 --- a/crates/milli/src/update/new/indexer/document_operation.rs +++ b/crates/milli/src/update/new/indexer/document_operation.rs @@ -94,6 +94,7 @@ impl<'pl> DocumentOperation<'pl> { while let Some(document) = iter.next().transpose().map_err(UserError::SerdeJson)? { + // TODO Do not allocate when it is not necessary let external_document_id = primary_key.extract_fields_and_docid( document, new_fields_ids_map, @@ -198,6 +199,7 @@ impl<'pl> DocumentOperation<'pl> { }; // And finally sort them + // TODO Can we sort in parallel? docids_version_offsets.sort_unstable_by_key(|(_, (_, docops))| sort_function_key(docops)); let docids_version_offsets = docids_version_offsets.into_bump_slice(); Ok(DocumentOperationChanges {