From 0f965d35747226e0fc7bf6056a491f4fea3fd48f Mon Sep 17 00:00:00 2001 From: ManyTheFish Date: Wed, 14 Aug 2024 14:33:36 +0200 Subject: [PATCH] Remove hotloop's spans --- .../extract/extract_facet_string_docids.rs | 28 ++++--------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/milli/src/update/index_documents/extract/extract_facet_string_docids.rs b/milli/src/update/index_documents/extract/extract_facet_string_docids.rs index 69663bb08..36dd20b15 100644 --- a/milli/src/update/index_documents/extract/extract_facet_string_docids.rs +++ b/milli/src/update/index_documents/extract/extract_facet_string_docids.rs @@ -269,28 +269,16 @@ fn extract_facet_string_docids_settings( } /// Normalizes the facet string and truncates it to the max length. -#[tracing::instrument(level = "trace", skip_all, target = "indexing::extract")] fn normalize_facet_string(facet_string: &str, locales: Option<&[Language]>) -> String { let options: NormalizerOption = NormalizerOption { lossy: true, ..Default::default() }; let mut detection = StrDetection::new(facet_string, locales); - let script = { - let span = tracing::trace_span!(target: "indexing::extract::extract_facet_string_docids", "detect_script"); - let _entered = span.enter(); - - detection.script() - }; - - let language = { - let span = tracing::trace_span!(target: "indexing::extract::extract_facet_string_docids", "detect_language"); - let _entered = span.enter(); - - // Detect the language of the facet string only if several locales are explicitly provided. - match locales { - Some(&[language]) => Some(language), - Some(multiple_locales) if multiple_locales.len() > 1 => detection.language(), - _ => None, - } + let script = detection.script(); + // Detect the language of the facet string only if several locales are explicitly provided. + let language = match locales { + Some(&[language]) => Some(language), + Some(multiple_locales) if multiple_locales.len() > 1 => detection.language(), + _ => None, }; let token = Token { @@ -300,10 +288,6 @@ fn normalize_facet_string(facet_string: &str, locales: Option<&[Language]>) -> S ..Default::default() }; - let span = - tracing::trace_span!(target: "indexing::extract::extract_facet_string_docids", "normalize"); - let _entered = span.enter(); - // truncate the facet string to the max length token .normalize(&options)