-
Notifications
You must be signed in to change notification settings - Fork 401
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: use swc to transform TS in jest #330
Conversation
Socket Security Pull Request Report👍 No new dependency issues detected in pull request Pull request report summary
Bot CommandsTo ignore an alert, reply with a comment starting with Ignoring: Powered by socket.dev |
Codecov ReportBase: 80.92% // Head: 80.61% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #330 +/- ##
==========================================
- Coverage 80.92% 80.61% -0.31%
==========================================
Files 65 65
Lines 5777 5691 -86
Branches 1014 1041 +27
==========================================
- Hits 4675 4588 -87
- Misses 1095 1096 +1
Partials 7 7
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Speed up est execution
The security check that is failing is for the install script from @swc/core, here's what the script does:
This alert can be ignored by replying with a comment starting |
I ran some benchmarks locally, and the improvement seems closer to ~ 15%, not 100%. I still think its worth merging in, but I want to make sure this discrepancy isn't the result of some other config issue before we do that. I used hyperfine to benchmark, and here's the output when running yarn test from main and clearing the cache each time
Here's the output when doing it on your branch:
|
Jest has its own cache for transformed modules separate from ts-jest:
swc:
|
That comes out much better, shows closer to a 40% improvement on an M1. I think its worth merging
|
@SocketSecurity ignore @swc/core@1.3.24 |
Motivation
Closes #314. Speed up
yarn test
by ~2x.Change Summary
Replace
ts-jest
with@swc/jest
to transform our TS files in Jest.Merge Checklist