-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Jest with SWC doesn't seem much faster than Jest with babel :( #1172
Comments
swc cannot optimize the time used for running test. It just reduces time of transpiling. |
@kdy1 That's a complete non answer to my question (if you actually read what I wrote, you'll see that I more or less accept that), so I'll restate it in the hope that someone will actually answer me:
|
For testing, especially benchmarks, transpiling code is likely less than 1% of the time spent on the test, so optimising 1% of a process will lead to the results you are seeing. I don't know the internals of jest, but I suspect it doesn't even transpile on every run, so you are only get a one off improvement in startup. |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
So I've spent today experimenting with swapping out
tsc
forswc
in our small typescript project (ejected create-react-app typescript/react), and if I'm honest I've been... a bit disappointed.The project is moderately small so test times are not a huge deal yet, but anticipating it getting bigger, I was looking for an improvement on testing times, but after benchmarking (using
yarn add jest-benchmark
) test runs withswc-jest
and the default babel config that comes with create react app, the speed seemed to be about the same.Here is the results of the benchmarking our jest tests with
swc
:And here is the same thing using our normal jest config:
As you can see; the improvement in the whole test run is about 0.25 seconds per run - nothing to write home about and certainly not worth swapping out a tried and tested part of our toolchain for. Now I appreciate that
babel
is likely not the only bottleneck in ajest
run, but given all the impressive claims I've seen in various places about swc, is this really what I'd expect to see? Or have I configured something wrong. Swappingbabel-loader
out forswc-loader
doesn't seem like a massive improvement in terms of build times either, though I've not yet found an easy way of benchmarking that. Below are the configs that I used to getswc
working:jestConfig
transform
block inpackage.json
.swcrc
The text was updated successfully, but these errors were encountered: