Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use fast path in modulefinder more often #17950

Merged
merged 1 commit into from
Oct 15, 2024
Merged

Conversation

hauntsaninja
Copy link
Collaborator

@hauntsaninja hauntsaninja commented Oct 15, 2024

See #17948

This is about 1.06x faster on mypy -c 'import torch' (in both the clean and openai environments)

  • 19.094 -> 17.896
  • 34.161 -> 32.214
λ hyperfine -w 1 -M 3 '/tmp/mypy_primer/timer_mypy_36738b392/venv/bin/mypy  -c "import torch" --no-incremental --python-executable clean/bin/python'
Benchmark 1: /tmp/mypy_primer/timer_mypy_36738b392/venv/bin/mypy  -c "import torch" --no-incremental --python-executable clean/bin/python
  Time (mean ± σ):     17.896 s ±  0.130 s    [User: 16.472 s, System: 1.408 s]
  Range (min … max):   17.757 s … 18.014 s    3 runs

 λ hyperfine -w 1 -M 3 '/tmp/mypy_primer/timer_mypy_36738b392/venv/bin/mypy  -c "import torch" --no-incremental --python-executable /opt/oai/bin/python' 
Benchmark 1: /tmp/mypy_primer/timer_mypy_36738b392/venv/bin/mypy  -c "import torch" --no-incremental --python-executable /opt/oai/bin/python
  Time (mean ± σ):     32.214 s ±  0.106 s    [User: 29.468 s, System: 2.722 s]
  Range (min … max):   32.098 s … 32.305 s    3 runs

Copy link
Contributor

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

Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

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

Thanks, another nice perf win.

@JukkaL JukkaL merged commit eb816b0 into python:master Oct 15, 2024
18 checks passed
@hauntsaninja hauntsaninja deleted the fast-path branch October 15, 2024 18:17
hauntsaninja added a commit that referenced this pull request Oct 20, 2024
See #17948

This is about 1.06x faster on `mypy -c 'import torch'` (in both the
clean and openai environments)
- 19.094 -> 17.896 
- 34.161 -> 32.214

```
λ hyperfine -w 1 -M 3 '/tmp/mypy_primer/timer_mypy_36738b392/venv/bin/mypy  -c "import torch" --no-incremental --python-executable clean/bin/python'
Benchmark 1: /tmp/mypy_primer/timer_mypy_36738b392/venv/bin/mypy  -c "import torch" --no-incremental --python-executable clean/bin/python
  Time (mean ± σ):     17.896 s ±  0.130 s    [User: 16.472 s, System: 1.408 s]
  Range (min … max):   17.757 s … 18.014 s    3 runs

 λ hyperfine -w 1 -M 3 '/tmp/mypy_primer/timer_mypy_36738b392/venv/bin/mypy  -c "import torch" --no-incremental --python-executable /opt/oai/bin/python' 
Benchmark 1: /tmp/mypy_primer/timer_mypy_36738b392/venv/bin/mypy  -c "import torch" --no-incremental --python-executable /opt/oai/bin/python
  Time (mean ± σ):     32.214 s ±  0.106 s    [User: 29.468 s, System: 2.722 s]
  Range (min … max):   32.098 s … 32.305 s    3 runs
```
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