Skip to content

Why use stream for warehouse#save()? #20

@segayuu

Description

@segayuu

The output by stream is obviously slower than fs.writeFile().
Nevertheless, stream is powerful because memory control by highWaterMark can prevent memory from being consumed too much at once.
However, this can not be realized with just Writable alone (at least Readable or Generator is almost required), you can ignore it, but in that case no memory control will be done and the stream loses its maximum advantage.
Although it is possible to use JSONStream.stringnify(), it is said that an issue has been posted, "It is 100 times slower than JSON.sringnify()".

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions