WIP: faster markdown#28992
Closed
chrisnojima wants to merge 7 commits intonojima/HOTPOT-next-670-cleanfrom
Closed
Conversation
- Add fast-path for plain text: skip parser entirely when no markdown chars or service decorations are present. Handles preview, serviceOnly, serviceOnlyNoWrap, and regular rendering modes. - Add lightweight service-only parser: for messages with service decorations but no markdown formatting, use a parser with only 6 rules instead of 15. - Cache parsed ASTs: LRU cache (200 entries) keyed on input text + parse level avoids re-parsing the same message on re-render. - Cache service decoration JSON: LRU cache (500 entries) for the base64 decode + JSON.parse in ServiceDecoration. - Hoist default styleOverride to avoid new object on every render. - Skip ErrorBoundary on mobile (unnecessary wrapper). - Remove dead noMarkdownParser code.
…jis to full parser - Restore serviceOnlyTextRegex that stops before $>kb$ tags, unicode chars, colons (emoji shortcodes), and newlines. The greedy [source] text rule was consuming service decoration tags. - Add emojiQuickCheck to getParseLevel so text containing emoji shortcodes or unicode emojis routes to 'full' instead of 'none', which skipped emoji rendering entirely.
…est, fix lint - Add PerfProfiler wrappers to markdown output components (MD-total, MD-paragraph, MD-serviceDecoration, MD-emoji) for fine-grained render timing via React Profiler - Add thread scroll Maestro perf test (perf-thread-scroll.yaml) - Speed up inbox/teams scroll Maestro tests (duration 150→10ms, waitToSettleTimeoutMs 10) - Fix serviceOnlyTextRegex to stop before colons (emoji shortcodes) - Fix emojiQuickCheck: split into cheap nonAsciiCheck + expensive unicodeEmojiCheck to avoid 14K regex on every message - Fix no-control-regex lint warning on nonAsciiCheck Co-Authored-By: Claude Opus 4.6 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Faster markdown parsing
Changes:
$>kb$decorations.{}on every render..@:in source.Array.isArray.Results (inbox scroll, 300 small rows):