You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Call binding recomputes candidate file facts on every call, so a cold Kubernetes build takes 21 minutes #5666
On v8 at d249de36 (0.9.124), a cold build of Kubernetes takes 21 minutes. Most of it goes to cross-file call binding, which recomputes facts about a candidate's source file once per candidate per call.
_go_import_path_for_file runs for each candidate of each Go selector call at graphify/extract.py:14516. Its cache only stores directories that contain a go.mod, so every call walks the ancestors again.
_lang_family runs for each candidate of each call.
disambiguate_ambiguous_candidates rebuilds set(test_cands) for each element at graphify/paths.py:512. That is quadratic, and it affects every language.
A py-spy profile attributes about 600s to the first, 33s to the second and 186s to the third.
To reproduce, clone kubernetes at ce9710e510 and run time graphify update .. Three runs took 1322s, 1262s and 1255s on Linux with CPython 3.12.3.
Expected: each file's facts are computed once per pass, and the output does not change.
changed the title [-]Cross-file call binding re-derives candidate file facts on every call, so a cold Kubernetes build takes 21 minutes[/-][+]Call binding recomputes candidate file facts on every call, so a cold Kubernetes build takes 21 minutes[/+]on Dec 1, 2026
Activity
github-actions commentedon Dec 1, 2026
Thanks for opening this issue, @Max17190. A maintainer will take a look soon.
If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.
To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.
[-]Cross-file call binding re-derives candidate file facts on every call, so a cold Kubernetes build takes 21 minutes[/-][+]Call binding recomputes candidate file facts on every call, so a cold Kubernetes build takes 21 minutes[/+]