-
Notifications
You must be signed in to change notification settings - Fork 5.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(node): seperate worker module cache #23634
Conversation
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After #23667, you can now declare serveral tests in __test__.jsonc
itself.
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.
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: |
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.
See #23634 (comment)
20facaf
to
031e841
Compare
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. Seems like there's some errors after merge though.
(We will circle back to add a string cache later)
Construct a new module graph container for workers instead of sharing it with the main worker. Fixes #17248 Fixes #23461 --------- Co-authored-by: David Sherret <[email protected]>
Construct a new module graph container for workers instead of sharing it with the main worker.
Fixes #17248
Fixes #23461