Skip to content

Conversation

@JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Feb 12, 2026

Use a set instead of a list for tracking not ready SCCs, since set provides a O(1) remove operation, instead of O(n) for lists. In a large codebase, up to 37% of CPU was spent in the list.remove call when doing a small incremental run.

Use a set instead of a list for tracking not ready SCCs, since set
provides a O(1) remove operation, instead of O(n) for lists. In a large
codebase, up to 37% of CPU was spent in the list.remove call when
doing a small incremental run.
@JukkaL JukkaL requested a review from ilevkivskyi February 12, 2026 11:55
@github-actions
Copy link
Contributor

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

Copy link
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Some things are only visible with a lot of files.

@JukkaL JukkaL merged commit 157b87d into master Feb 12, 2026
23 checks passed
@JukkaL JukkaL deleted the speed-up-process-graph branch February 12, 2026 13:18
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.

2 participants