Skip to content

Making blob.stream() more stream friendly #42264

Description

@jimmywarting

Version

17.5

Platform

mac

Subsystem

No response

What steps will reproduce the bug?

const blob = new Blob(data)

// Sometime later
blob.stream()

How often does it reproduce? Is there a required condition?

it reproduce every time, it's not clear to everyone that stream() will internally use blob.arrayBuffer()

What is the expected behavior?

to yield small chunks of data to not allocate as much memory as blob.size

What do you see instead?

I see memory spikes that when i create large blobs and then later tries to read them that memory goes way up.
this is one of the reason we are sticking to using fetch-blob instead of node's own built in blob implementation instead. I wish i did not have to use this package anymore and that i could also take adv of transfering blob's over workers with the built in transferable blob.

Additional information

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bufferIssues and PRs related to the buffer subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions