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.
probably not the correct fix, but with this change the tests pass at least, which is a good start 🙂
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.
|
jeysal
left a comment
There was a problem hiding this comment.
Hopefully this will have the desired effect 🙏
|
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)