Skip to content

Send serialized ASTs to parallel workers#20991

Open
ilevkivskyi wants to merge 2 commits intopython:masterfrom
ilevkivskyi:parallel-no-parse
Open

Send serialized ASTs to parallel workers#20991
ilevkivskyi wants to merge 2 commits intopython:masterfrom
ilevkivskyi:parallel-no-parse

Conversation

@ilevkivskyi
Copy link
Member

@ilevkivskyi ilevkivskyi commented Mar 8, 2026

This way we can properly benefit from native parser in parallel type checking. Self-check is now ~2.2x faster with 5 workers compared to in-process checking (also with native parser). Also it uses less memory, but still with 5 workers, self-check takes ~twice more memory compared to in-process.

Implementation is mostly straightforward. The GC freeze hack needed some tuning, as there is no single hot-spot in terms of allocations anymore.

Note: do not use maturin develop for any performance measurements, as this creates some very slow wheel.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 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