Pearl: Folding an `Iterator<Item = &HashSet<T>>`

They're actually effectively global static objects that together simulate a sort of database Index. They're formed when the program launches and kept in a series of HashMap<K, HashSet<&T>>s.

Searches can be performed on multiple Ks at once, and doing so invokes "AND" semantics, hence the series of set intersections. Doing so gives me O(klogn) lookup time on in-memory data, which in practice I'm observing to be smokin' fast.

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.