experiment(compiler): Add experimental SWC compiler#10598
Merged
Conversation
96e21a3 to
626fe25
Compare
50f72ef to
801de42
Compare
araujobarret
previously approved these changes
Jul 26, 2022
AlicanAkyuz
previously approved these changes
Jul 26, 2022
AlicanAkyuz
left a comment
Contributor
There was a problem hiding this comment.
really looking forward to having this experiment on main 🍾
rquartararo
previously approved these changes
Jul 26, 2022
rquartararo
left a comment
Member
There was a problem hiding this comment.
Very nice! When testing this locally I’m seeing significant time savings with yarn build and yarn jest => down from 36s to 16s for yarn build and 20s to 16s for yarn jest. 🎉
Contributor
Author
|
Awesome y'all. I need to fix a few tests but once that's done we can get this into |
Contributor
Author
@araujobarret - this surprised me too 😄. Not many hacks, but it was quite hard to find how all the pieces fit together since there are no docs. I need to open a PR to the SWC repo giving an example. |
Contributor
Author
|
My results:
|
aa93d5e
aa93d5e to
5308ae1
Compare
c958bc1 to
9211f80
Compare
ee992c9 to
85c578f
Compare
85c578f to
b0acec8
Compare
Merged
anandaroop
added a commit
that referenced
this pull request
Oct 20, 2023
* test: extract RTL-based test helpers for artwork filters * refactor: convert SizeFilter spec to use new helpers * refactor: convert KeywordFilter spec to use new helpers * test: un-pend KeywordFilter specs Follow up to #10598
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The type of this PR is: Experiment
Description
Similar to Next.js, this PR updates force to use the Rust-based SWC compiler for compilation performance. Still need to run the numbers a bit more and compare against a few things as the results so far are milder than I'd expect. However, that said, everything is just about working! Force compiles and things run as one would expect.
Given the bleeding-edge nature of this work, the time savings need to be substantial enough en-masse to justify moving away from Babel. That Next.js is using it as its main compiler is promising, though.
Update (8/5/2022):
Turning this flag on by default, which should apply to both tests and local development. To opt-out, set this flag in your
.env:A handful of tests (~12) were disabled in this commit and flagged with a comment:
Many of these tests were anomalous; we should go through and resolve but not hold up the performance wins in this PR in the meantime.
Also note that SWC compilation is not enabled in prod; this is only a dev-time DX / CI test runner performance improvement.
Changes:
@swc/jestfor compiling Jest tests with SWC@swc/plugin-relayfor compilingrelaygraphql tags@swc/plugin-styled-componentsfor extracting styled-components style tags for SSR renderingHave also added a new CI job (
test-swc) so that we can compare the old against the new)Issues:
Some Test Commands:
EXPERIMENTAL_SWC_COMPILER=true yarn start, then make changes here and there and resaveEXPERIMENTAL_SWC_COMPILER=true yarn build:client:devEXPERIMENTAL_SWC_COMPILER=true yarn jest Apps/AuctionEXPERIMENTAL_SWC_COMPILER=false yarn startEXPERIMENTAL_SWC_COMPILER=false yarn build:client:devEXPERIMENTAL_SWC_COMPILER=false yarn jest Apps/AuctionInitial Results:
yarn jest Apps/Auction: 35s babel, 18s SWC. With cache 13syarn build:client:dev: 75s babel, 38s SWC. With cache 12s