Make file packager --no-heap-copy always apply, and remove the option #12027
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The old default was to copy a file package into main memory (into space
malloc'd for it). That was not memory-efficient as it meant the main memory
needed to be bigger, and also the memory could never be freed. While
mmap on that could be fast, we added the
--no-heap-copy
option tokeep file data on the JS heap and not copy it in. That uses less memory
but still is just as fast at fread etc.
This makes that newer option the default, and removes the option to do it
the old way. This is better for memory usage, and in any case people using
file data in a heavy way may be rolling their own solutions anyhow.
This also removes the file system usage of
getMemory()
, which wouldperform allocation during startup from JS, which is a source of complexity
I am working to remove for WebAssembly/binaryen#3043