Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
) * chore: More optimal IterateHierarchyV2 and iterateChildrenV2 [#600] Closes #600 The existing (effectively v1) implementations are suboptimal since they don't construct a graph before the iteration. They search for children by looking at all namespace resources and checking `isParentOf`, which can give `O(tree_size * namespace_resources_count)` time complexity. The v2 algorithms construct the graph and have `O(namespace_resources_count)` time complexity. See more details in the linked issues. Signed-off-by: Andrii Korotkov <[email protected]> * improvements to graph building Signed-off-by: Michael Crenshaw <[email protected]> * use old name Signed-off-by: Michael Crenshaw <[email protected]> * chore: More optimal IterateHierarchyV2 and iterateChildrenV2 [#600] Closes #600 The existing (effectively v1) implementations are suboptimal since they don't construct a graph before the iteration. They search for children by looking at all namespace resources and checking `isParentOf`, which can give `O(tree_size * namespace_resources_count)` time complexity. The v2 algorithms construct the graph and have `O(namespace_resources_count)` time complexity. See more details in the linked issues. Signed-off-by: Andrii Korotkov <[email protected]> * finish merge Signed-off-by: Michael Crenshaw <[email protected]> * chore: More optimal IterateHierarchyV2 and iterateChildrenV2 [#600] Closes #600 The existing (effectively v1) implementations are suboptimal since they don't construct a graph before the iteration. They search for children by looking at all namespace resources and checking `isParentOf`, which can give `O(tree_size * namespace_resources_count)` time complexity. The v2 algorithms construct the graph and have `O(namespace_resources_count)` time complexity. See more details in the linked issues. Signed-off-by: Andrii Korotkov <[email protected]> * discard unneeded copies of child resources as we go Signed-off-by: Michael Crenshaw <[email protected]> * remove unnecessary comment Signed-off-by: Michael Crenshaw <[email protected]> * make childrenByUID sparse Signed-off-by: Michael Crenshaw <[email protected]> * eliminate duplicate map Signed-off-by: Michael Crenshaw <[email protected]> * fix comment Signed-off-by: Michael Crenshaw <[email protected]> * add useful comment back Signed-off-by: Michael Crenshaw <[email protected]> * use nsNodes instead of dupe map Signed-off-by: Michael Crenshaw <[email protected]> * remove unused struct Signed-off-by: Michael Crenshaw <[email protected]> * skip invalid APIVersion Signed-off-by: Michael Crenshaw <[email protected]> --------- Signed-off-by: Andrii Korotkov <[email protected]> Signed-off-by: Michael Crenshaw <[email protected]> Co-authored-by: Michael Crenshaw <[email protected]>
- Loading branch information