perf(parser): cleanup and optimize parsing jsx#14234
Merged
Boshen merged 1 commit intooxc-project:mainfrom Sep 30, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR optimizes JSX parsing performance by eliminating unnecessary checkpoint/rewind operations and streamlining span construction. The changes focus on reducing parser overhead during JSX fragment and element parsing.
- Removes checkpoint/rewind mechanism when parsing JSX closing fragments/elements
- Eliminates the
parse_jsx_assignment_expressionwrapper function in favor of directparse_expr()calls - Optimizes span construction by avoiding intermediate span allocations and using direct calculations
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
CodSpeed Instrumentation Performance ReportMerging #14234 will not alter performanceComparing Summary
|
8c6897b to
b01f81a
Compare
b01f81a to
c18c0df
Compare
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.
Removed what seems like unnecessary Context wrapping of parse_jsx_assignment_expression. Please double check on that, tests are at least still all green.
Also moved more common code into parse_jsx_fragment to shorten call sites.