-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
fix: cache transforms within a worker #8890
Conversation
Config.ProjectConfig, | ||
ProjectCache | ||
> = new WeakMap(); | ||
const projectCaches = new Map<string, ProjectCache>(); |
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.
probably not the correct fix, but with this change the tests pass at least, which is a good start 🙂
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.
Yeah I think this is alright.
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.
LGTM
Codecov Report
@@ Coverage Diff @@
## master #8890 +/- ##
==========================================
+ Coverage 64.24% 64.24% +<.01%
==========================================
Files 275 275
Lines 11656 11657 +1
Branches 2844 2844
==========================================
+ Hits 7488 7489 +1
Misses 3544 3544
Partials 624 624
Continue to review full report at Codecov.
|
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.
Hopefully this will have the desired effect 🙏
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.
Shipit!
repo checkout timed out on azure, and everything passed before merging in master, so the failure is w/e. @scotthovestadt could you test this at FB and merge+release if it looks OK? 🙂 |
Let's have this merged already, as folks reportedly come back with better results. @scotthovestadt feel free to test the latest master then :) |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
May or may not fix #7811, but it looks pretty good!
Due to the changes in #7186, we no longer cached transformed files between tests within a single worker. Not sure why, but we get a cache miss in the weakmap. Anyone has any good ideas?
@rafeca I realise you don't work at FB aymore, but FYI just in case you remember some context or have any comments 🙂
Test plan
Added test. Without the changes in
ScriptTransformer
, this is the result of the new test:(I've since tweaked this test to work on Windows, but it's still essentially accurate)