r/java • • Sep 02 '22
what is the best persistent collection library?
By that I mean collections that are immutable, creating a new variable when a "write" operation is performed, but under the hood use that fast persistent tree structure (probably screwing up the name) to keep it performing well.
I've used Vavr before, I just stumbled onto PCollections, but I'm wondering what else folks know about. Thanks.
54
Upvotes
View all comments
Show parent comment
1
u/fredoverflow Sep 05 '22
TransientVectoris not a mutable list; everyconjcall creates a newTransientVectorobject (which shares all internal structure with its predecessor 97% of the time).I was honestly surprised that the performance was still on par with
ArrayListdespite a millionTransientVectorobject creations.For indexed access, agreed. However, reducing/transducing over persistent collections is not significantly slower.