-
Notifications
You must be signed in to change notification settings - Fork 4
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: Load SAPUI5 types only when needed #46
Conversation
052480c
to
2432db2
Compare
052480c
to
878c589
Compare
LGTM I've done a perf measurement with a lint against
|
Thanks for doing a measurement. I just did some manual tests and for me the benefit was about 5s for sap.m. |
src/detectors/typeChecker/host.ts
Outdated
.filter((entry) => entry.isFile() && entry.name.endsWith(".d.ts") && entry.name !== "index.d.ts") | ||
.map((entry) => entry.name); |
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.
Nitpick (decide for yourself): Replace with a for-loop. For reference, see also https://romgrk.com/posts/optimizing-javascript#3-avoid-arrayobject-methods
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.
We'll probably never have more than 100 entries here and the function is only called once per linting, but I guess it makes sense to be consistent and prevent multiple looping over arrays in general.
9048ebd
to
fa4a111
Compare
fa4a111
to
b3d57cc
Compare
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.
LGTM
No description provided.