Commit 28751e9
Optimize SCC scheduler
The `not_ready_deps` was populated with each direct dependency ID to do
the two operations below:
- mark a dependency as completed by discarding it
- check if all dependences are done based on if it's empty
All of these could be done with a counter. The ids are never actually
being used/inspected, just the size. So with a counter, we can just
populate a counter with `len(dep_sccs)`, and rather than discarding an
id we can just decrement the counter, and we can check if the counter is
zero for when all dependencies have been completed.
This is roughly a ~2% speed up on a warm run.
---------
Co-authored-by: Ivan Levkivskyi <levkivskyi@gmail.com>not_ready_deps tracking (#21389)1 parent 5e7e91b commit 28751e9
1 file changed
Lines changed: 12 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
| |||
4619 | 4619 | | |
4620 | 4620 | | |
4621 | 4621 | | |
4622 | | - | |
4623 | | - | |
4624 | | - | |
4625 | | - | |
| 4622 | + | |
| 4623 | + | |
| 4624 | + | |
| 4625 | + | |
| 4626 | + | |
4626 | 4627 | | |
4627 | 4628 | | |
4628 | 4629 | | |
| |||
5003 | 5004 | | |
5004 | 5005 | | |
5005 | 5006 | | |
5006 | | - | |
| 5007 | + | |
| 5008 | + | |
5007 | 5009 | | |
5008 | | - | |
| 5010 | + | |
5009 | 5011 | | |
5010 | 5012 | | |
5011 | 5013 | | |
| |||
0 commit comments