Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Zero-alloc trie lookups #3998

Merged
merged 10 commits into from
Jan 6, 2017
Merged

Zero-alloc trie lookups #3998

merged 10 commits into from
Jan 6, 2017

Conversation

rphmeier
Copy link
Contributor

Trie half of #3993

Also does some more code cleanup and adds an OwnedNode type which can be used for trie iterators.

The shared portion of lookup with TrieDB and TrieDBMut is refactored into a lookup module which was simpler to write iteratively. When HashDB gets get_with then it will use that and be truly zero-alloc.

@rphmeier rphmeier added A0-pleasereview 🤓 Pull request needs code review. M4-core ⛓ Core client code / Rust. labels Dec 29, 2016
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling dcf7881 on trie-iterative into ** on master**.

}

impl<'a> Query for &'a mut Recorder {
type Item = DBValue;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since recording queries often don't care about the value itself it might make sense just to use () here.

@gavofyork
Copy link
Contributor

an additional test or two for the new API?

@rphmeier
Copy link
Contributor Author

rphmeier commented Jan 5, 2017

@gavofyork Not 100% sure what there is left to test -- Regular get still works from the existing test corpus. Recording still works as expected from the recorder tests. The Query trait works because A) it compiles, and B) The get and record tests are using it.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 3f3d1a5 on trie-iterative into ** on master**.

@gavofyork gavofyork added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Jan 6, 2017
@gavofyork
Copy link
Contributor

didn't see any unit tests specifically targeting get_with

@gavofyork gavofyork merged commit 9c00eb4 into master Jan 6, 2017
@gavofyork gavofyork deleted the trie-iterative branch January 6, 2017 15:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants