Closed shanecelis closed 5 months ago
Doh. I forgot to rebase onto master before submitting PR. Rebased and force pushed to map-as-root
branch.
I'm gonna work on this one a little more and try to minimize the additional methods. Instead of adding *_ref()
variants, maybe I'll have another module called declone
or something that has declone::{Trie, TrieBuilder}
.
I'm withdrawing this one. I've got to workshop it some more.
I apologize; this one's a doozy. I've been working happily with
trie-rs::map::Trie
but I uncovered some bugs depending on what order entries were inserted, they would overwrite the values of preceding entries. This bothered me enough that I decided to try swapping fromcrate::Trie
being the "root" data structure tocrate::map::Trie
being the root. Each struct remains in their expected place.Iterators
I got a PR into
louds-rs
that adds iterators that I wanted to use intrie-rs
. I've added variants of the search methods ending in_ref()
since they return references instead of clones.Decloned
I removed the dependency on
Clone
forLabel
andValue
. Some methods do requireClone
but it's now on a method-by-method basis and it's not essential to the library's use.Mutable Values
Values in
map::Trie
can be mutated withexact_match_mut()
.Breaking changes
The API has been kept such that it should be source compatible with any
crate::Trie
uses. However, there are breaking changes forcrate::map::Trie
and the builders now consume self onbuild()
.Incremental Search
I added an incremental search so that a user can service interactive applications as performantly as possible. It's accessed with
trie.inc_search()
. There are tests and the docs show an example of its usage.Docs
I updated the readme with an example of mutating values and incremental search.
Performance
I ran the benchmarks with
--release
and backported a few benchmarks tomaster
to confirm there weren't any regressions. Much of it remains the same,predictive_search()
appears to be two times faster. And the*_big_output()
tests run with a query that has a huge number of matches, 4220 to be exact but only consumes 100 of them, which is a very contrived way to show off lazy iterator performance.Current
New