carry key during iteration #10
rafaelkallis
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
@evanxg852000 has suggested a new feature in #9
Iteration would be more convenient if the key would be accessible like so:
We want to study potential solutions and their respective trade-offs.
1) Wrapped value
A simple workaround would be to wrap values in a struct that has a key property before inserting them to the data structure. When iterating through the tree, the key can be accessed from the wrapped value.
The performance overhead imposed by this should be negligible.
The memory overhead on the other hand might be severe (depending on the key size), since full keys are now also stored.
2) Recompute keys during iteration
While iterating through the tree, we keep track of the key prefix during each step, adding or removing partial keys from the key as we iterate.
The implementation could have a negative impact on performance, but this is speculative, implementations must be benchmarked to reason about performance.
There should not be any memory overhead for the data structure itself since no additional data is stored. More memory will be required for iteration but the impact is expected to be negligible.
iteration is implemented here https://github.com/rafaelkallis/adaptive-radix-tree/blob/a15cfd48adc6daa30917311e8440ee947004777b/include/art/tree_it.hpp
methods
greater_equal
andoperator++
implementation in progress: #11
performance overhead: 8-9% (tested on uniform and zipf distributed keys)
memory overhead: O(logn)
Beta Was this translation helpful? Give feedback.
All reactions