-
-
Notifications
You must be signed in to change notification settings - Fork 509
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(linter): no-fallthrough
: Use string matching instead of Regex for default comment pattern
#6008
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @camchenry and the rest of your teammates on |
Your org has enabled the Graphite merge queue for merging into mainAdd the label “0-merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
abc0b33
to
eb09ff1
Compare
CodSpeed Performance ReportMerging #6008 will not alter performanceComparing Summary
|
Merge activity
|
…for default comment pattern (#6008) Profiling has shown this rule to be a consistent slow point, and in particular, the Regex construction is slow. <img width="1323" alt="Screenshot 2024-09-23 at 7 12 58 PM" src="https://github.com/user-attachments/assets/1d9b367d-eeda-4b19-b0a3-463e54ac4334"> This PR improves the situation in two ways: 1. A `Regex` is only constructed when there is a custom comment pattern (which is likely the minority of cases) 2. For the default comment pattern (when no custom pattern is passed), we now use a simple string matcher function, instead of a full-blown regex matcher. I believe this should be faster since it involves much less work, though can still allocate a `String`.
eb09ff1
to
5ae3f36
Compare
## [0.9.8] - 2024-09-24 ### Bug Fixes - e3c8a12 linter: Fix panic in sort-keys (#6017) (Boshen) - 4771492 linter: Fix `import/no_cycle` with `ignoreTypes` (#5995) (Boshen) ### Performance - 5ae3f36 linter: `no-fallthrough`: Use string matching instead of Regex for default comment pattern (#6008) (camchenry) - 2b17003 linter, prettier, diagnostics: Use `FxHashMap` instead of `std::collections::HashMap` (#5993) (camchenry) --------- Co-authored-by: Boshen <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Profiling has shown this rule to be a consistent slow point, and in particular, the Regex construction is slow.
This PR improves the situation in two ways:
Regex
is only constructed when there is a custom comment pattern (which is likely the minority of cases)String
.