Skip to content

Improve implementation of merge #340

Open
@gjcairo

Description

@gjcairo

merge currently allocates more than it should on next calls, by creating new arrays with no pre-reserved capacity. What’s more, in its current form of allowing max 3 streams to be merged, this array could actually just be a tuple and avoid the allocation altogether.

There are comments throughout the implementation that suggest the idea was to eventually use variadic generics to merge N streams. We should decide if this is something we actually want to do, and either reserve enough capacity in the continuations array to avoid the constant resizing, or stick to a tuple if we won’t allow more than 3 (or some other fixed number of) 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