Skip to content

Conversation

@ulrichstark
Copy link
Contributor

@ulrichstark ulrichstark commented Sep 28, 2025

Locally I'm seeing these improvements, but Codspeed doesn't show them :(

image

Copilot AI review requested due to automatic review settings September 28, 2025 14:25
@github-actions github-actions bot added A-parser Area - Parser C-performance Category - Solution not expected to change functional behavior, only performance labels Sep 28, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR optimizes the re-lexing of angle tokens in TypeScript parsing by simplifying the API and improving control flow. The changes reduce indirection and make the code more direct by removing unnecessary return values and simplifying conditional logic.

  • Refactored re-lexing functions to use direct offset parameters instead of Kind-based matching
  • Simplified control flow in type argument parsing by using early returns
  • Changed re-lexing functions to return void instead of Kind tokens

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
crates/oxc_parser/src/ts/types.rs Refactored type argument parsing to use early returns and simplified re-lexing calls
crates/oxc_parser/src/lexer/typescript.rs Simplified re-lexing functions to accept offset parameters directly
crates/oxc_parser/src/cursor.rs Updated re-lexing functions to return void and use direct offset matching

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@codspeed-hq
Copy link

codspeed-hq bot commented Sep 28, 2025

CodSpeed Instrumentation Performance Report

Merging #14208 will not alter performance

Comparing ulrichstark:cleanup-and-optimize-re-lexing-angle-tokens (64e556e) with main (aa0689f)1

Summary

✅ 37 untouched

Footnotes

  1. No successful run was found on main (6ff3a23) during the generation of this report, so aa0689f was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@Boshen Boshen self-assigned this Sep 28, 2025
@ulrichstark ulrichstark force-pushed the cleanup-and-optimize-re-lexing-angle-tokens branch from 67f8872 to 64e556e Compare September 28, 2025 15:15
@Boshen Boshen merged commit 653aa8a into oxc-project:main Sep 30, 2025
28 checks passed
@ulrichstark ulrichstark deleted the cleanup-and-optimize-re-lexing-angle-tokens branch October 4, 2025 15:25
@Boshen Boshen mentioned this pull request Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-parser Area - Parser C-performance Category - Solution not expected to change functional behavior, only performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants