Skip to content

preview2 shim browser filesystem writeViaStream has O(n^2) overhead due to repeatedly concatenating buffers #1069

@TerrorJack

Description

@TerrorJack

See

writeViaStream(_offset) {
, when this is invoked repeatedly to do a lot of small appends, there is O(n^2) slowdown due to repeatedly concatenating buffers. I noticed this when working on bjorn3/browser_wasi_shim#95; almost all wasi in-memory vfs implementation written in js/ts I can find has the same issue, including this one.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions