python / python/mypy

Finding modules is a bottleneck for parallel checking on Windows

Open
#21,336 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

parallel checking performance
Dominant language
Python
Stars
20.6k
Forks
3.3k
PR merge metrics
PR metrics pending

Description

While doing some basic profiling on Windows, it looks like finding modules is a major bottleneck, taking most of the initial graph loading (part that cannot be parallelized currently). Here are example build stats from coordinator process (unimportant things skipped) on self-check:

find_module_time:       0.591
graph_load_time:        0.877
scc_wait_time:          3.639  # this is actual processing time

For comparison, finding modules on self-check takes 50-100ms on Mac/Linux. Not sure what exactly is going on here, but this may be something we want to try optimizing.

cc @JukkaL @emmatyping

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the Windows self-check profiling described in the issue, focusing on the coordinator process during initial graph loading. Trace the module-finding path and compare its timing with Mac/Linux; the work is done when a measured optimization reduces the Windows bottleneck without changing checking behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools, performance
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.