Fast filtering needs based on reachability #615
Replies: 2 comments 3 replies
-
Hi, Unfortunately, I see no way to add a pre-calculated reachability matrix somewhere and reuse it easily. Not with the current features Sphinx and Sphinx-Needs are providing via config. But I think such a reachability matrix would be helpful for everybody and speed up things. I think developing a solution directly in Sphinx-Needs is much faster than optimizing your approach with the currently available feature set. What do you think? First idea: We could create a common graph for all needs. Based on networkX? |
Beta Was this translation helpful? Give feedback.
-
the 'needs' should form a directed acyclic graph. Once constructed, it should be fairly cheap to traverse |
Beta Was this translation helpful? Give feedback.
-
I'd like to filter needs based on reachability, i.e. keep all needs that are related to the current one through either
requires
,links_back
,tests_back
, etc. recursively, to produce an extract of only relevant elements in a needflow.Right now I'm using this custom filter function but it's very slow because it's called for every single need, and we have hundreds of them. Any recommendation on how to optimize it? I've thought about pre-computing a reachability matrix once, so that the filtering can be much faster by just looking up indexes. But where would I put this pre-computing code?
Beta Was this translation helpful? Give feedback.
All reactions