perf(formatter): reduce clone overhead in JSDoc formatting#20136
perf(formatter): reduce clone overhead in JSDoc formatting#20136Dunqing wants to merge 2 commits intofeat/jsdoc-comment-formattingfrom
Conversation
Avoid cloning Vec-containing FormatOptions fields (sort_imports, sort_tailwindcss, jsdoc) when creating type/embedded format options. Uses struct update syntax with None overrides instead of full clone, which eliminates heap allocations for the Vec fields that are irrelevant to JSDoc type formatting and embedded code formatting. Also skips import tag processing when no @import tags exist (common case), and defers merged_desc String allocation until needed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Merging this PR will not alter performance
Comparing Footnotes
|

Avoid cloning Vec-containing FormatOptions fields (sort_imports,
sort_tailwindcss, jsdoc) when creating type/embedded format options.
Uses struct update syntax with None overrides instead of full clone,
which eliminates heap allocations for the Vec fields that are
irrelevant to JSDoc type formatting and embedded code formatting.
Also skips import tag processing when no @import tags exist (common
case), and defers merged_desc String allocation until needed.
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com