-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[Refactor]: improve performance for detecting function components #3265
[Refactor]: improve performance for detecting function components #3265
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3265 +/- ##
==========================================
- Coverage 97.69% 97.69% -0.01%
==========================================
Files 121 121
Lines 8586 8583 -3
Branches 3118 3120 +2
==========================================
- Hits 8388 8385 -3
Misses 198 198
Continue to review full report at Codecov.
|
default: | ||
this.skip(); | ||
} | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoids unnecessary traversals by skipping all node types but the handled cases.
if (isJSXValue(node)) { | ||
found = true; | ||
breakTraverse(); | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above and simplify by not using astUtil.traverse
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't pretend I understand this change, but if all the tests pass, then i guess yay?
The gist is that |
98c615e
to
365849c
Compare
Benchmark on a private repo with
time npx eslint .
(real time):Benchmark with
TIMING=10 npx eslint .
:Before:
After: