triemap icon indicating copy to clipboard operation
triemap copied to clipboard

Implement specialized spliterators on {Entry,Key}Set

Open rovarga opened this issue 6 years ago • 4 comments

We are currently using SpliteratorIterators backed by our custom iterators. This is a bit wasteful, because it allocates an additional object and in case of MutableTrieMap (and hence Mutable{Entry,Key}Set) we end up wrapping the immutable internal structure with a mutable wrapper for each object. The second part is important, as it is completely unneeded as spliterators cannot modify state, hence we should be able to just traverse an immutable view of the map.

rovarga avatar Sep 05 '18 00:09 rovarga

@rovarga are the keys ordered? (Skiplist/tree map)

asad-awadia avatar Mar 23 '22 00:03 asad-awadia

@rovarga are the keys ordered? (Skiplist/tree map)

No. A Triemap is akin to a ConcurrentHashMap in this regard. That having been said, a ConcurrentNavigableMap with O(1) snapshot capability could be built using the approach used for internal organization of TrieMap -- I think :)

rovarga avatar Mar 23 '22 07:03 rovarga

@rovarga

approach used for internal organization of TrieMap

What do you mean by this?

asad-awadia avatar Mar 23 '22 14:03 asad-awadia

@rovarga

approach used for internal organization of TrieMap

What do you mean by this?

I mean an equivalent of a TreeMap could be done via #87 .

rovarga avatar Mar 31 '22 17:03 rovarga