-
-
Notifications
You must be signed in to change notification settings - Fork 4.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
build(tsc): Refactor emotion types so we use less memory #16913
Conversation
This patch essentially backports emotion-js/emotion#1501 to dramatticaly reduce the number of types generated during compilation. This reduces the number of types from ~700k to 200k which translates to more than 50% reduction in type check time and memory consumption. Using the command `tsc --noEmit --extendedDiagnostics` | Metric | Before | After | |:------|--------:|------:| | Files | 1189 | 1189 | | Lines | 484378 | 484571 | | Nodes | 892394 | 893030 | | Identifiers | 296394 | 296638 | | Symbols | 769880 | 719992 | | Types | **705230** | **202553** | | Memory used | **1024710K** | **747802K** | | Assignability cache size | 576214 | 382608 | | Identity cache size | 7697 | 6167 | | Subtype cache size | 18326 | 18307 | | I/O Read time | 0.36s | 0.30s | | Parse time | 2.13s | 1.76s | | Program time | 4.28s | 3.48s | | Bind time | 1.25s | 0.94s | | Check time | **40.85s** | **16.66s** | | Total time | **46.38s** | **21.09s** |
How confident are we that this will fix the node OOM errors? We were having them before upgrading to emotion@10 fwiw. |
I've removed the memory increase flags so CI will tell us. This almost halves the memory, at least it was like that last time I tried but the numbers I but here are more modest. I am still quite hopeful :) |
Ehh, I guess Jest still consumes a lot of memory. I think we can still remove the other memory extension flags though, what do you think @billyvg? I don't get any memory issues when compiling locally. Do you? |
We should keep them, we added it because people were having these memory issues |
@billyvg looks like we're good now? |
Woah. Impressive stat numbers! 👏 |
I'm able to confirm the stats locally on my dev.
I used the command: |
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.
Looks good to me 👍
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.
Thanks for fixing this! Types seem to be still working and build times are definitely better.
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.
Good job 👏
This patch essentially back-ports emotion-js/emotion#1501 to dramatically
reduce the number of types generated during compilation. This reduces
the number of types from ~700k to ~200k which translates to more than 50%
reduction in type check time and memory consumption.
Using the command
tsc --noEmit --extendedDiagnostics