usethesource / capsule

The Capsule Hash Trie Collections Library
BSD 2-Clause "Simplified" License
404 stars 27 forks source link

Question: Why not Vectors? #18

Closed FrankC01 closed 7 years ago

FrankC01 commented 7 years ago

With a full grok of capsule attained, kudos again, I'm wondering why not Vectors (as in Clojure vectors)?

Does the sequential nature diminish the space/performance advantage of Trie?

Curious but not critical.

msteindorfer commented 7 years ago

Hi Frank, vectors will be added in the future.

There's no technical reason or limitation (I'm well acquainted with literature on persistent vectors), I just didn't allocate the time yet to properly engineer a performant vector data type.

The optimizations of sets/maps and vectors are different, because the former are sparse data structures whereas the latter are typically implemented as dense data structures.

FrankC01 commented 7 years ago

Thanks, as I am using Clojure's Vector and capsule's Map and Set as references for a non-java runtime implementation I'm set for the moment. If I venture into moving my Vector I will let you know of any observations I may have.