Replies: 1 comment
-
I think all information that's needed to make traversal efficient is in the Here information can be tracked pertaining the current level of iteration. Once this method is called we know that we are about to enter another level. However, for this problem, it appears all you'd want is to iterate all entries of a single level, best done with I hope that helps. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary 💡
As mentioned here the git-traverse crate only support non-ordered breadthfirst traversal.
https://github.com/Byron/gitoxide/blob/ff9e1571b558475e727dc6ba11dab24ef15fb6f4/git-repository/src/object/tree/traverse.rs#L47-L48
Motivation 🔦
I am building a git platform using gitoxide.
The tree explorer you can see in the screenshot below use the current breadth-first search traversal.
The current implementation works fine but needs to traverse the entire tree from root each time we load a page. An alternative would be to load the tree in order with a given depth to get only what needs to be rendered.
Example
And this is the real life use case :
I have no idea if this is doable, I will try to implement it if you are ok with the idea.
Otherwise I will just cache everything :)
Beta Was this translation helpful? Give feedback.
All reactions