Skip to content
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

[Feature]: Memory consumption of assets may to reduce in development mode #9391

Open
h-a-n-a opened this issue Feb 19, 2025 · 0 comments
Open
Labels
team The issue/pr is created by the member of Rspack.

Comments

@h-a-n-a
Copy link
Contributor

h-a-n-a commented Feb 19, 2025

What problem does this feature solve?

In development mode, assets are stored twice in Rspack:

  • Assets being stored in Compilation.asset on the Rust side
  • Assets being emitted to OutputFileSystem on the Node side in memfs

BoxSource is the backing struct of CompilationAsset. It contains non-continuous memory spreading across internal sources.
This is the same as webpack's implementation. Additionally, assets are emitted to memfs as well.

We can might migrate memfs from Node.js to Rust, of course with some tinkering to let assets only being stored once.
On top of rust memfs, again this is just a basic idea, so it might not be as precise, we can use a data structure using path and BoxSource to store code, skipping another buffer copy.

What does the proposed API of configuration look like?

~

@h-a-n-a h-a-n-a added pending triage The issue/PR is currently untouched. and removed pending triage The issue/PR is currently untouched. labels Feb 19, 2025
@github-actions github-actions bot added the team The issue/pr is created by the member of Rspack. label Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team The issue/pr is created by the member of Rspack.
Projects
None yet
Development

No branches or pull requests

1 participant