-
Notifications
You must be signed in to change notification settings - Fork 64
Description
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!