Skip to content

random slow down #19230

Closed
Closed
@stevenh

Description

@stevenh

Bug Report

Using a basic check on the command line for a package I'm developing which has a bunch of dependencies mypy can be quick or or very slow ranging from 2s to over 40s, with seemingly no rhyme or reason to it. Even consecutive runs without touching the code can exhibit the slowdown.

To Reproduce

Hard to create a reproduction as it seems to be totally random

~/code/projectX$ time mypy src/ tests/
Success: no issues found in 78 source files

real    0m6.214s
user    0m4.533s
sys     0m0.863s
~/code/projectX$ time mypy src/ tests/
Success: no issues found in 78 source files

real    0m42.895s
user    0m37.618s
sys     0m3.718s

Expected Behavior

I would expect the time to run to be relatively constant when little to no changes made.

Actual Behavior

Random slow down even when the code hasn't been touched.

~/code/projectX$ time mypy src/ tests/
Success: no issues found in 78 source files

real    0m6.214s
user    0m4.533s
sys     0m0.863s
~/code/projectX$time mypy src/ tests/
Success: no issues found in 78 source files

real    0m2.638s
user    0m2.138s
sys     0m0.496s
~/code/projectX$time mypy src/ tests/
Success: no issues found in 78 source files

real    0m2.740s
user    0m2.169s
sys     0m0.568s
~/code/projectX$ time mypy src/ tests/
Success: no issues found in 78 source files

real    0m2.985s
user    0m2.314s
sys     0m0.596s
~/code/projectX$ time mypy src/ tests/
Success: no issues found in 78 source files

real    0m42.895s
user    0m37.618s
sys     0m3.718s

Your Environment

  • Mypy version used:
mypy --version
mypy 1.16.0 (compiled: yes)
  • Mypy command-line flags: none
  • Mypy configuration options from mypy.ini (and other config files):
[tool.mypy]
strict = true
mypy_path = ["typing"]
exclude = '.*/data$'

[[tool.mypy.overrides]]
module = [
  "advertools",
  "datasets",
  "evaluate",
  "crawl4ai.*"
]
ignore_missing_imports = true
  • Python version used:
    python --version
    Python 3.12.9
  • Hardware:
    MacBook Pro - Apple M3 Max running Sequoia 15.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions