Following #1128, another thing that would help performance for TopologicalSorter for the intended use-cases on Qiskit is if it were to allow single indices in its done method. In practice, all the reasons we use the on-line sorter for involve looking at nodes one at a time and making a decision about them, and the overhead of constructing new Python lists and then unwrapping them into Rust vecs is quite expensive.
I'm happy to make a PR, just before I do: would we prefer to have a separate done_single method, or to overload done?
What is the expected enhancement?
Following #1128, another thing that would help performance for
TopologicalSorter
for the intended use-cases on Qiskit is if it were to allow single indices in itsdone
method. In practice, all the reasons we use the on-line sorter for involve looking at nodes one at a time and making a decision about them, and the overhead of constructing new Python lists and then unwrapping them into Rust vecs is quite expensive.I'm happy to make a PR, just before I do: would we prefer to have a separate
done_single
method, or to overloaddone
?