Skip to content

Stream performance improvement ideas #117

Open
@benjamingr

Description

@benjamingr

cc @anonrig from our chat

  • Reduce memory overhead by using bit maps instead of many booleans for state
  • Use a deque instead of a linked list for the BufferList
  • Optimize for a single pipe rather than an array of pipes and fallback to array of pipes

More wild ideas:

  • Split Readable into several classes and "bailout" from fast to slow ones (e.g. objectMode and bytes, multiple readers vs. one, flowing vs. non flowing) based on most streams not changing their type during their lifetime.
  • Don't require a "full" event emitter necessarily for a stream unless the user is listening to an event and "fast-path" if a stream is piped

cc @ronag @nodejs/streams

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions