Type Checker Timing Benchmarks

Daily performance analysis of Python type checkers

Measuring wall-clock execution time and peak memory usage when type checking popular open-source Python packages

Loading...

Run Summary

Type Checker Comparison

Typical time to check a package

Typical peak memory

Geometric mean of peak resident memory, over the same packages as above.

Didn't finish

Runs that hit the 5-minute timeout or the 4 GB memory limit, or crashed. Those packages are left out of every summary above for all checkers, so each checker is summarized over the same packages.

Type Checker Package Reason

Every Package

Time per checker *. marks the fastest, along with any checker within a fixed tolerance of it (10 ms or 5%). The small number is how many times slower than the fastest. ⓘ marks a note on how checkers differ on that package.

Loading results...

Methodology

What We Measure

We benchmark the full type checking process for each type checker running against real-world Python packages. This measures wall-clock execution time and peak RSS (resident set size) memory.

Test Process

  1. Shallow-clone each package from GitHub
  2. Install package dependencies per install_envs.json into a fresh virtual environment used only for that package, and point every type checker at it
  3. Run each type checker with 1 warmup run (discarded) + 1 measured run, with a 5-minute timeout per run
  4. Record wall-clock time (to the millisecond) and peak memory usage of the measured run

Timeout: Each type checker has a 5-minute timeout. Timeouts and OOM kills are recorded as failures.

Memory: On Linux, peak RSS is reported by GNU /usr/bin/time using %M. On macOS, it comes from /usr/bin/time -l. Separately, on Linux the runner polls /proc/{pid}/status (VmRSS) to enforce the memory limit; that polling is not the reported peak.

Dependencies & Check Paths

Each package's environment is configured in install_envs.json:

  • install: Whether to pip install -e . the package itself
  • deps: Additional pip packages to install
  • install_env: Environment variables for installation
  • check_paths: Subdirectories to type check (e.g. ["src"]). When omitted, the entire package root is checked.

Only packages with install: true or a non-empty deps list are benchmarked.

Configuration Overrides

Packages often ship their own type checker configs that can skew benchmark comparisons. We do our best to run each checker in its default setting with as neutral a configuration as possible. To do this, we generate a minimal config file for each checker that embeds the check_paths in its native format and pass it via CLI flags to override any package-level config:

  • Pyright: pyrightconfig.json with "include": [paths] written in-place
  • Mypy: [mypy] with files = paths and check_untyped_defs = True via --config-file
  • ty: [src] include = [paths] in ty.benchmark.toml via --config-file
  • Pyrefly: project_includes = [paths] in pyrefly.benchmark.toml via --config
  • Zuban: [mypy] with files = paths and check_untyped_defs = True via --config-file

This means every checker sees exactly the same target paths and a neutral configuration, regardless of what the package ships.

Mypy note: By default, mypy skips the bodies of functions that lack type annotations. The other four checkers all analyze unannotated code. We enable check_untyped_defs = True so that mypy checks the same amount of code as the other tools.

Metrics Explained

  • Time (s): Full-process wall-clock execution time, including startup and any interpreter queries, to the millisecond. No interpreter-query cost is subtracted.
  • Memory (MB): Peak resident set size in megabytes
  • Didn't finish: Timed out, hit the memory limit, or crashed

Interpreter queries: locally verified November 19, 2026

Why query Python? A checker needs to locate installed packages and select types for the target Python version and platform. Asking the selected interpreter gives it environment details directly, including Python's import search paths. Which details are queried varies by checker.

The tradeoff: Launching Python adds latency, included in these timings. Reading environment files, such as a virtual environment's pyvenv.cfg, can avoid that launch cost, but relies on recognizing the environment layout. Unusual installations or search paths may need explicit configuration. Both approaches can discover a standard virtual environment successfully; query counts alone do not establish correctness.

With Python 3.12 on macOS, a fresh package virtual environment, and this runner's generated configs and interpreter flags, we observed:

  • Pyrefly 1.5.0: One query for version, platform, and import paths. Pyrefly configuration.
  • Pyright 1.1.414: Two queries with --pythonpath, for version and import paths. Pyright environment discovery.
  • mypy 2.4.1: One query with --python-executable pointing to the separate package environment. Using mypy's own interpreter can avoid this extra process. mypy import discovery.
  • ty 0.0.107: No interpreter launch observed with --python pointing to the virtual-environment directory. ty environment discovery.
  • Zuban 0.10.2: No interpreter launch observed with --python-executable pointing into that virtual environment. Zuban configuration.

Query counts depend on versions and configuration. This local audit does not establish counts for every historical result or platform, and its injected delay is not an estimate of normal query overhead. A discarded warmup does not remove queries in subsequent fresh processes. Reproduce the audit.

Summary Statistics

Package sizes span three orders of magnitude. An ordinary average is dominated by the few largest packages, where one slow result can outweigh dozens of typical ones. The headline figure is therefore the geometric mean of the time per package, which weighs every package equally in relative terms and is the usual way benchmark suites are summarized. The median, average and total are available as alternatives; the average and total suit readers who mostly care about very large codebases.

Every summary uses only the packages that all checkers finished, so each checker is summarized over the same packages.

Type Checkers

Pyright Type checker for Python by Microsoft
Pyrefly Type checker for Python by Meta
ty Type checker for Python by OpenAI
Mypy Static type checker for Python
Zuban Type checker for Python by the creator of Jedi