Skip to content

perf(parser): avoid redundant Kind checks when parsing for loops #11799

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

ulrichstark
Copy link
Contributor

@ulrichstark ulrichstark commented Jun 18, 2025

Summary of changes to avoid the redundant Kind checks:

  • split parse_for_in_or_of_loop function into parse_for_in_loop and parse_for_of_loop
  • decide early on if it's Kind::In or Kind::Of

@github-actions github-actions bot added A-parser Area - Parser C-performance Category - Solution not expected to change functional behavior, only performance labels Jun 18, 2025
Copy link

codspeed-hq bot commented Jun 18, 2025

CodSpeed Instrumentation Performance Report

Merging #11799 will not alter performance

Comparing ulrichstark:avoid-redundant-kind-checks-when-parsing-for-loops (4e2a887) with main (08e666f)

Summary

✅ 38 untouched benchmarks

@ulrichstark
Copy link
Contributor Author

+0.3% parser[react.development.js]
+0.2% parser[binder.ts]
   0% parser[cal.com.tsx]
-0.1% parser[RadixUIAdoptionSection.jsx]

Looks good 🚀

@Boshen
Copy link
Member

Boshen commented Jun 19, 2025

+0.3% parser[react.development.js]
+0.2% parser[binder.ts]
   0% parser[cal.com.tsx]
-0.1% parser[RadixUIAdoptionSection.jsx]

Looks good 🚀

NICE!

@Boshen Boshen merged commit a8e4f01 into oxc-project:main Jun 19, 2025
25 checks passed
@ulrichstark ulrichstark deleted the avoid-redundant-kind-checks-when-parsing-for-loops branch June 19, 2025 14:41
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