Merged
Conversation
…in memfs. we have careful logic there to avoid allocating too much or too frequently, and it just uses 8x less memory than a js array in v8
dschuff
approved these changes
Jan 23, 2019
juj
added a commit
to juj/emscripten
that referenced
this pull request
Jan 14, 2021
… was removed, dropping the support for using regular JS Arrays to back MEMFS file storage. In this PR, complete the removal of old code that related to JS Array backing, since all files are now typed array backed.
juj
added a commit
that referenced
this pull request
Jan 14, 2021
* In PR #7918, the option MEMFS_APPEND_TO_TYPED_ARRAYS=0 was removed, dropping the support for using regular JS Arrays to back MEMFS file storage. In this PR, complete the removal of old code that related to JS Array backing, since all files are now typed array backed. * Migrate tests to use the MEMFS typed array API. * Fix tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This removes the option to use normal JS arrays. They are nicer for appending of small files perhaps, but on large ones they take 8x the memory, and are slower and can lead to OOMs. See discussion in #7630.
The logic we have for typed arrays is fairly smart - it doesn't just double naively - and so should be pretty good even with the extra copying of typed arrays.