Google drops Pytype for Meta's Pyrefly, citing 10x faster Python type checking

Open-source Rust-based checker cuts compute costs and rebuild latency, but developers differ on benchmarking

By LineZotpaper
Published
Read Time3 min
Google has replaced its long-standing Python type checker, Pytype, with Pyrefly, an open-source tool originally developed by Meta, citing roughly 10 times faster type checking, up to 98% lower incremental rebuild latency and more than 80% lower peak compute costs.

Google announced it has adopted Pyrefly as its Python type checker, replacing Pytype after years of service. The company said the decision was driven by Pyrefly's speed, accuracy and lower infrastructure costs.

Pytype worked by analyzing compiled bytecode rather than source abstract syntax trees. Google said keeping pace with modern typing PEPs became an increasing maintenance burden, with bytecode instability across Python releases making updates difficult.

Internal benchmarks cited by Google show Pyrefly is approximately 10 times faster than Pytype, reduces incremental rebuild latency by up to 98%, and cuts peak compute cost for Python type checking by more than 80%. The company also reported a 90 to 99% reduction in type-checking time along clean-build critical paths, saying this substantially eliminated a long-standing development bottleneck.

Google said Pyrefly has strong conformance to Python's typing specification, passing about 97% of tests in the conformance suite. It is also actively supported by the community, helping it keep pace with new syntax, and its diagnostics offer more actionable feedback, including inline code annotations that pinpoint the root cause of errors and, in some cases, suggest fixes.

Reaction among developers has been mixed. Commenting on Google's announcement, one user, Gushys, said Pyrefly is much more mature, is already past version 1.0, has similar performance to ty, and is a proven tool, while ty is not quite there yet. WindHawkeye countered that Mypy is much faster in large setups than people think and still has the fastest incremental type check. BeamMeUpBiscotti replied that Mypy 2.0 is expected to be up to five times faster on large projects for cold checks, but that newer generation checkers can be an order of magnitude faster still.

Python developer Amirrea Azadmher, commenting on LinkedIn, argued that a type checker's value lies not merely in saving 30 seconds in CI pipelines but in how it improves the edit-check loop during development. He advised developers not to trust someone else's monorepo numbers when evaluating Pyright, Pyrefly and Mypy, and to measure cold and warm times on their own tree, scoring diagnostics quality beside throughput, since a fast checker that floods you with noise still costs more than a slower one that points at the real break.

Meta open-sourced Pyrefly last year. The tool is implemented in Rust and, according to Meta, can check 1.8 million lines of code per second on large codebases, making typechecking on every keystroke possible.

§

Analysis

Why This Matters

  • Python's type checking ecosystem is central to large codebases, and a major Google migration signals which tooling wins at scale.
  • Google's claimed cuts in compute and latency could influence how other organizations choose type checkers.
  • The shift could put pressure on established alternatives such as Mypy and Pyright.

Background

Python is a dynamically typed language, but type hints let developers annotate code and tools check it statically before runtime. Several checkers exist, including Mypy, Pyright and Pytype, with Pyrefly a newer entrant. Google had long used Pytype, a checker it developed, but maintenance became harder as Python's typing system evolved. Pyrefly, created by Meta and open-sourced last year, was built for speed in Rust.

Key Perspectives

Google: The company frames the switch as a performance and cost win, citing faster checks, lower compute and better conformance to the typing specification. Meta and Pyrefly maintainers: They designed the tool for high performance, with claims of checking millions of lines per second and making incremental checks fast enough for per-keystroke feedback. Community developers: Reactions vary. Some call Pyrefly mature and proven, while others defend Mypy's incremental performance or argue that benchmark numbers from large monorepos may not transfer to other projects.

What to Watch

  • Whether Google's benchmarks translate to smaller or differently structured codebases, and whether independent benchmarks confirm them.
  • How long Google continues to maintain Pytype for existing users, and whether it is eventually deprecated.
  • Continued conformance suite scores as Python's typing specifications evolve.

Sources

Checked

12 claims in this story checked against 1 source: 12 supported.

Show each claim
  1. SupportedGoogle drops Pytype for Meta's Pyrefly (replaced Pytype with Pyrefly)InfoQ: “Google has replaced its long-standing Python type checker, Pytype, with Pyrefly, an open-source tool originally developed by Meta.”
  2. SupportedPyrefly is 10x faster than PytypeInfoQ: “Pyrefly is approximately 10 times faster than Pytype.”
  3. SupportedPyrefly cuts compute costs and rebuild latencyInfoQ: “reduces incremental rebuild latency by up to 98%, and cuts peak compute cost for Python type checking by more than 80%.”
  4. SupportedDevelopers differ on benchmarkingInfoQ: “While most commenters agreed that Pytype performs worse than Pyrefly, others debated Pyrefly's relative merits compared with Ty and Mypy.”
  5. SupportedUp to 98% lower incremental rebuild latencyInfoQ: “reduces incremental rebuild latency by up to 98%.”
  6. SupportedMore than 80% lower peak compute costsInfoQ: “cuts peak compute cost for Python type checking by more than 80%.”
  7. Supported90 to 99% reduction in type-checking time along clean-build critical pathsInfoQ: “Google also reported a 90–99% reduction in type-checking time along clean-build critical paths.”
  8. SupportedPasses about 97% of tests in the conformance suiteInfoQ: “passing approximately 97% of tests in the conformance suite.”
  9. SupportedGushys said Pyrefly is much more mature, past v1.0, similar performance to ty, proven tool; ty not there yetInfoQ: “Gushys noted that Pyrefly is much more mature. Its already at past 1.0, has similar performance speed to ty, and is a proven tool. ty just isn't quite there yet.”
  10. SupportedWindHawkeye said Mypy is much faster in large setups and still has fastest incremental type checkInfoQ: “WindHawkeye observed that 'Mypy is much faster in large setups than people think. It still has the fastest incremental type check'”
  11. SupportedBeamMeUpBiscotti said Mypy 2.0 expected up to 5x faster for cold checks, newer checkers order of magnitude fasterInfoQ: “BeamMeUpBiscotti replied that Mypy 2.0 is supposed to be up to 5x faster on large projects for cold checks, but the newer generation of type checkers can be up to an order of magnitude faster than even that.”
  12. SupportedPyrefly is implemented in Rust and can check 1.8 million lines of code per secondInfoQ: “Pyrefly is designed for high performance and implemented in Rust to maximize efficiency. According to Meta, it can check 1.8 million lines of code per second on large codebases.”

Zotpaper

Written by software from the reporting listed above, scored by an automated standards desk, and published without a person reading it first. If something here is wrong, tell the editor and it will be put right.

How we workSubscribe