Skip to content

Performance improvement proposal for mongoose Query streams #7094

@ergoithz

Description

@ergoithz

I've benchmarked mongoose streams against mongodb streams and found mongoose was one order of magnitude slower.

I think there is a performance problem on current implementation, relying on continuously using mongo's cursor.next along with non-trivial flow control code to mongoosify returned documents.

IMHO, using an streaming approach involving mongo's Cursor.pipe along with stream's Transform, thus leveraging the flow control entirely to the efficient Readable.pipe interface, will result on much better numbers and, maybe, simpler code.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions