-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(scope-manager): only call Object.entries once for each lib #10647
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
feat(scope-manager): only call Object.entries once for each lib #10647
Conversation
Thanks for the PR, @dmichon-msft! typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community. The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately. Thanks again! 🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. |
✅ Deploy Preview for typescript-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
View your CI Pipeline Execution ↗ for commit 1210cad.
☁️ Nx Cloud last updated this comment at |
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.
Thanks for doing this!
Let's just go one step further here and remove the need for any runtime calls to Object.entries
.
We can just generate all of the lib files as an array of arrays so that there's no calls at all!
Same with the barrel file -- we can generate the map contents as an array of arrays.
Since you gave me license to restructure the objects from the individual |
I'm happy to go with a bigger refactor of how all of this works. Just need to get the tests passing and we can move forward with this! |
I can rebase/merge this to reconcile the changes to exports that happened a bit back, I just hadn't since the guidance was to leave that to maintainers. |
f7ee0a6
to
3cda068
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #10647 +/- ##
=======================================
Coverage 87.44% 87.44%
=======================================
Files 469 469
Lines 16047 16053 +6
Branches 4649 4650 +1
=======================================
+ Hits 14032 14038 +6
Misses 1658 1658
Partials 357 357
Flags with carried forward coverage won't be shown. Click here to find out more.
|
thanks heaps for this! |
Before this change, running https://github.com/typescript-eslint/performance:
After:
Nice 🔥 |
PR Checklist
Overview
Improves performance of
populateGlobalsFromLib
by ensuring that the referenced lib objects have theirObject.entries
arrays precomputed. Also saves on garbage collection since each object only ever has a single array of variable specifications.