fitzee commented on PR #39885: URL: https://github.com/apache/superset/pull/39885#issuecomment-4392549723
Good catch — addressed in `2505ac4b50`. You're right that `isProbablyHTML` itself does `DOMParser` work for HTML-looking strings, so the previous `stripHtmlToText` cache only saved roughly half the cost. Moved the cache one level up: introduced `toComparableText(raw)` that combines detection + extraction with a single `Map<string, string>` lookup. Both `htmlTextFilterValueGetter` and `htmlTextComparator` go through it now, so each unique string cell value pays the detection/parsing cost once per session — repeat comparisons on the same value (which dominate during sort) become Map lookups. Plain strings cache to themselves and skip repeated `isProbablyHTML` invocations too. Existing tests still pass. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
