-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Speed up check-build-type-declaration-files #62538
Conversation
Size Change: 0 B Total Size: 1.76 MB ℹ️ View Unchanged
|
9e5ac50
to
b4b1423
Compare
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
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.
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.
Makes sense to me 👍
* Remove npx usage from declaration checking script * Revert "Remove npx usage from declaration checking script" This reverts commit d5a1fe5. * Try skipLibCheck Co-authored-by: sirreal <jonsurrell@git.wordpress.org> Co-authored-by: cbravobernal <cbravobernal@git.wordpress.org> Co-authored-by: noahtallen <noahtallen@git.wordpress.org>
What?
The
./bin/packages/check-build-type-declaration-files.js
script runs onbuild:package-types
(and therefore onbuild
). It's run very frequently and is pretty slow.This tries two simple strategies to speed it up.
No npx
(Reverted due to unsufficient impact)
npx
adds some overhead. Calling thetsc
binary directly is faster, but this only saves a couple of ms per run.1.06 ± 0.04 times faster than trunk
trunk
branch
skipLibCheck
Our types are compiled without
skipLibCheck
enabled, so the libraries we use should be checked. When we run this script, there's so much interdependence between our packages that we're checking out own package types over and over and we checking all of our libraries again. We should be able to enableskipLibCheck
and save some time, the lib check is the point of this script itself.If there were problems in our packages, without
skipLibCheck
enabled we'd see the same problems over and over for the packages themselves and for every dependent package.3.15 ± 0.12 times faster than trunk
trunk
branch
Testing Instructions
node ./bin/packages/check-build-type-declaration-files.js
should be faster on this branch than on trunk.Future
This should be a good candidate for parallelization with something likeworker-farm
for bigger gains.