-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimise data transfer in
TopologicalSorter
This optimises the creation of the `list` objects returned from `TopologicalSorter.get_ready` (by avoiding a temporary `Vec`) and allows `done` to accept a single index, avoiding the need for the user to allocate many small lists in several real-world uses.
- Loading branch information
1 parent
9216f86
commit 2979762
Showing
4 changed files
with
104 additions
and
62 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
releasenotes/notes/toposort-done-single-5d5db2c654e5b498.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
features: | ||
- | | ||
:meth:`.TopologicalSorter.done` now accepts single integers, in addition to lists of integers. | ||
This can be a sizeable performance improvement for algorithms that iterate through nodes, and | ||
only conditionally mark them as `done`; there is no longer a need to allocate a temporary Python | ||
array. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters