Skip to content

mypy 0.990 is 1000x slow on pydantic codebase vs 0.982 #14034

@samuelcolvin

Description

@samuelcolvin

Bug Report

Running mypy on the current pydantic codebase (specifically the code as of pydantic/pydantic#4735), give the following run times:

  • running mypy pydantic with mypy 0.982, and no .mypy_cache: 8s
  • running mypy pydantic with mypy 0.982, .mypy_cache present: 0.17s
  • running mypy pydantic with mypy 0.990, and no .mypy_cache: 3m19s
  • running mypy pydantic with mypy 0.990, .mypy_cache present: 3m6s

(1000x comes from (3 * 60 + 6) / 0.17)

There are quite a few errors, mostly due to no_implicit_optional=True, but still - this seems like a significant regression.

While mypy 0.990 is running, I see 100% usage on 1 CPU.

To Reproduce

Should be as simple as cloning pydantic, checkout that branch (uprev-mypy), install requirements from requirements/linting.txt, run mypy.

Your Environment

  • Mypy version used: 0.990
  • Mypy command-line flags: just mypy pydantic
  • Mypy configuration options from mypy.ini (and other config files): see this bit of pyproject.toml
  • Python version used:3.10.0 (just realised how old my version of 3.10 is, I've upgraded to 3.10.8, same result)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions