fix(node): seperate worker module cache#23634
Conversation
There was a problem hiding this comment.
How's the memory usage? Does it reuse the Arc<str> when it can? (ex. for remote modules)
Also, what happens with --reload?
There was a problem hiding this comment.
@littledivy do you think we could reduce memory usage by sharing the strings in memory when they're the same?
There was a problem hiding this comment.
yeah, maybe we could store specifier -> hash mapping in a shared container and compare that in the file fetcher. Doing this check without comparing specifiers first may be expensive but more effective in some cases.
| @@ -0,0 +1,4 @@ | |||
| { | |||
There was a problem hiding this comment.
nit: it would be nice to convert this test into a step under worker_threads folder instead of creating worker_threads_cache folder.
There was a problem hiding this comment.
Hmm. I thought it would be clean to convert several tests of a module into steps but it will break reporting.
There was a problem hiding this comment.
After #23667, you can now declare serveral tests in __test__.jsonc itself.
bartlomieju
left a comment
There was a problem hiding this comment.
Drive-by: can we add tests for both Web and Node workers that verify this behavior?
|
Looks like some wpt tests are failing now. |
It's a new test thats passing now. |
|
Other issues that might potentially get fixed by this one: |
20facaf to
031e841
Compare
Construct a new module graph container for workers instead of sharing it with the main worker.
Fixes #17248
Fixes #23461