Skip to content

[WIP] Optimize SCC scheduler not_ready_deps tracking#21389

Draft
KevinRK29 wants to merge 1 commit intopython:masterfrom
KevinRK29:not-read-deps
Draft

[WIP] Optimize SCC scheduler not_ready_deps tracking#21389
KevinRK29 wants to merge 1 commit intopython:masterfrom
KevinRK29:not-read-deps

Conversation

@KevinRK29
Copy link
Copy Markdown
Collaborator

@KevinRK29 KevinRK29 commented May 1, 2026

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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant