Skip to content
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

perf: improve regex performance #17789

Merged
merged 1 commit into from
Jul 29, 2024
Merged

perf: improve regex performance #17789

merged 1 commit into from
Jul 29, 2024

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Jul 29, 2024

Description

Follow-up from #17788

This PR enables eslint typechecking when it runs in IDEs as typechecking is slow to be enabled by default. I fiddled with other options, but this seems like the best balance that doesn't affect local DX but still encourages better code written.

With that setup (and the rules added from #17788), I'm able to detect additional places where some regex refactors help improve performance, especially for using RegExp#exec is faster than String#match.

I had previously ran some benchmarks from lukeed/polka#210, which showed that RegExp#exec is consistently faster than String#match, especially for longer regex or strings.

Copy link

stackblitz bot commented Jul 29, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link
Member

@patak-dev patak-dev left a comment

Choose a reason for hiding this comment

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

👏🏼

@patak-dev patak-dev merged commit 952bae3 into main Jul 29, 2024
14 checks passed
@patak-dev patak-dev deleted the eslint-typecheck-ide branch July 29, 2024 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants