Skip to content

Document performance/memory behaviour for PersistentX.Builder #224

@kyay10

Description

@kyay10

I can imagine this is a complicated topic, and maybe there's no guaranteed behaviour, so feel free to ignore this request!
The docs currently mention that e.g. build and builder both use the same underlying structure, and so are (maybe?) constant time.
However, they don't mention anything else about the time complexity of the operations on builder. Is the assumption that the time complexity is identical to the persistent structure itself (so Builder.add(x) takes constant time, but add(i, x) takes longer, just like how PersistentList operates normally?). Or are some operations asymptotically more efficient on the builders than on the persistent structures themselves?
In fact, a more general recommendation of "should you build a list/map/set first, then convert it to persistent vs build it using a persistent list/map/set builder` would be very very helpful!

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