You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, TopologicalSorter hashes every index both as it goes through get_ready and as it's returned to done and builds up a hashmap of the size of all visited nodes, only for the purposes of emitting Python-space errors if the user does something incorrectly. None of "putting in an invalid node", "putting in an unready node" and "putting in an already done node" should cause a Rust-space panic (though will ofc cause the algorithm to give nonsensical results).
It'd be nice for performance if there was a way to use a TopologicalSorter that didn't have that memory and runtime overhead. Philosophically, I'd like it if it wasn't there at all, so there's two separate Rust pyclasses, one with error-checking compiled in and one without (and new just builds the correct one), but I think most of my concern would be addressed by making TopologicalSorter::node2state an Option and deciding whether to check it at runtime.
Again, I'll make the PR if there's a chosen direction.
The text was updated successfully, but these errors were encountered:
What is the expected enhancement?
At the moment,
TopologicalSorter
hashes every index both as it goes throughget_ready
and as it's returned todone
and builds up a hashmap of the size of all visited nodes, only for the purposes of emitting Python-space errors if the user does something incorrectly. None of "putting in an invalid node", "putting in an unready node" and "putting in an already done node" should cause a Rust-space panic (though will ofc cause the algorithm to give nonsensical results).It'd be nice for performance if there was a way to use a
TopologicalSorter
that didn't have that memory and runtime overhead. Philosophically, I'd like it if it wasn't there at all, so there's two separate Rustpyclass
es, one with error-checking compiled in and one without (andnew
just builds the correct one), but I think most of my concern would be addressed by makingTopologicalSorter::node2state
anOption
and deciding whether to check it at runtime.Again, I'll make the PR if there's a chosen direction.
The text was updated successfully, but these errors were encountered: