KEMBAR78
Try fixing test times after GC hack by ilevkivskyi · Pull Request #19766 · python/mypy · GitHub
Skip to content

Conversation

@ilevkivskyi
Copy link
Member

I am not sure what happens, but for some reason after GC freeze()/unfreeze() hack #19681 was merged, compiled tests are running twice slower (on GH runner, but I also see much smaller but visible slow-down locally). I have two theories:

  • The constant overhead we add outweighs the savings when running thousands of tiny builds.
  • The 8% of extra memory we use goes over the limit in the runner because we were already very close to it.

In any case, I propose to try disabling this hack in most tests and see if it helps.
cc @JukkaL

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

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

@ilevkivskyi
Copy link
Member Author

Judging from the fact that only disabling this for pythoneval tests (the only place where we currently set test_env = True AFAICT) it is probably the second. I am not sure why we are using so much memory in tests. I will check now what is the memory overhead from the GC hack for some realistic workloads.

@ilevkivskyi
Copy link
Member Author

Yeah, this seems to be a tests-only problem. I tried couple things and don't see any difference in peak RSS. I am going to merge this for now to speed-up CI.

@ilevkivskyi ilevkivskyi merged commit 1660a39 into python:master Aug 30, 2025
20 checks passed
@ilevkivskyi ilevkivskyi deleted the fix-test-memory branch August 30, 2025 22:44
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