Skip to content

Idea for reducing array allocations in functions that use shrink #587

Description

@sjakobi

In functions like filter and intersection we allocate a mutable array, fill it as needed, then shrink it and return it as a BitmapIndexed or Full node.

I wonder whether we could reduce these allocations by starting out with a bitmap that records which subnodes we keep or remove. Only once we encounter a node that is changed, e.g. a BitmapIndexed node reduced to a Leaf, we allocate an array for the result.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions