-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trie as facade for map::Trie #22
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Remove extraneous code extracted into frayed.
Doh. I forgot to rebase onto master before submitting PR. Rebased and force pushed to |
I'm gonna work on this one a little more and try to minimize the additional methods. Instead of adding |
I'm withdrawing this one. I've got to workshop it some more. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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