-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Description
This is an issue to define tasks to improve ESLint performance per the recommendations from the "Speeding up the JavaScript ecosystem - eslint" blog post:
https://marvinh.dev/blog/speeding-up-javascript-ecosystem-part-3/
I was able to extract five recommendations from the blog post that relate to eslint core or eslint dependencies. Please add more if I missed something.
-
Token store's
utils.search
should use a binary search algorithm.We could implement our own, or find a library. In fact, this used to be a binary search before Chore: Remove lodash #14287. The performance impact of switching to
Array#findIndex
was discussed in Chore: Remove lodash #14287 (comment), but at the time performance tests did not show significant differences. Regardless, I think we should reintroduce binary search here. -
Refactor the code to avoid calling the mentioned
utils.search
/ instantiatingBackwardTokenCommentCursor
millions of times.This suggestion requires further analysis. I'm not sure if the premise that we can avoid this because "we should know exactly where we are" applies here because
BackwardTokenCommentCursor
is used by methods that take an arbitrary node/token, such asSourceCode#getTokensBefore
. -
Several points on improving
esquery
performance.This has already been implemented in Optimize hot code paths estools/esquery#134. Our Single File and Multi Files performance tests show ~8% overall performance improvement. 🚀
-
Fast path for simple selectors ("Bailing out early" section in the blog post).
The suggestion is to handle the simplest selectors in the form of "NodeType" manually, without using esquery. We could definitely give this a try.
-
"Rethinking selectors" section in the blog post.
I'm not sure what is the recommendation here, is it to drop declarative selectors in favor of js functions that would be provided by rules?
Metadata
Metadata
Assignees
Labels
Type
Projects
Status