Skip to content

Consider addAll special cases #154

Open
@chuckjaz

Description

@chuckjaz

When a PersistentVector<T> is added to another PersistentVector<T> through addAll this can be optimized and, when the shift alligns, layers of the vector, as a whole, can be copied over instead of copying individual elements. Even if the shifts don't allgin, copyInto can be used instead of going through the addAll of the builder which can avoid several otherwise unncessary allocations and virtual dispatches.

A similar technique can be used for the TrieNode for the PersistentHashMap but the special cases end up not being nearly as rare as it will often be the case when whole TrieNodes can be copied from one PersistentHashMap to another.

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