perf: replace MDAST tag extraction with a linear PascalCase scan - #1581
Draft
erunion wants to merge 2 commits into
Draft
perf: replace MDAST tag extraction with a linear PascalCase scan#1581erunion wants to merge 2 commits into
erunion wants to merge 2 commits into
Conversation
mdxishTags and RMDX tags were running full parse+runSync pipelines just to collect component names. A fence/magic-block-aware scan is enough and keeps large docs like release notes near-instant while preserving builtin exclusions. Co-authored-by: Cursor <cursoragent@cursor.com>
mdxishTags no longer registers micromark extensions, so remove its FEATURES preset and update the centralisation guard test. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
parse+runSyncinmdxishTagsand RMDXtagswith a shared linear PascalCase scanner (scanPascalCaseTags)readmeComponentsTransformerBenchmarks
Measured with Vitest on Node, cold call + 5 steady-state calls (median). Memory deltas are
process.memoryUsage()before/after the cold call (heap used / RSS).Fixture A — real Artifactory release notes (
artifactory-self-managed-releases.md, ~719KB)Primary case that motivated this change (~95
<Callout>, ~180<Anchor>, GFM tables).mdxishTagsmdxishTagsmdxishTagsmdxishTagstags(RMDX)micromark-extension-mdx-jsx)Fixture B — synthetic valid MDX (~932KB, 2800× Callout/Anchor/CustomWidget/TableBlock)
Used so RMDX
tagscan be compared apples-to-apples (strict MDX).mdxishTagsmdxishTagsmdxishTagsmdxishTagstags(RMDX)tags(RMDX)tags(RMDX)tags(RMDX)tags(RMDX)Test plan
__tests__/lib/mdxishTags.test.tsand__tests__/lib/tags.test.tsgreen (including<<VARIABLE>>, nested tags, Table semantics)tags/mdxishTagsstill get expected component lists for custom components