Skip to content

Conversation

@kripken
Copy link
Member

@kripken kripken commented Jan 23, 2019

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.

…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
@kripken kripken merged commit bdb8e87 into incoming Jan 23, 2019
@kripken kripken deleted the no-MEMFS_APPEND_TO_TYPED_ARRAYS branch January 23, 2019 22:51
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants