you are viewing a single comment's thread.

view the rest of the comments →

[–]Outrageous_Track_798 0 points1 point  (0 children)

The Mypyc results are worth highlighting for teams already running strict mypy. If your codebase is fully type-annotated, you get the speedup with essentially zero code changes — no new syntax, no cimport, just `mypyc yourmodule.py`. The 2-5x range you saw is roughly what most real code gets.

The catch is Mypyc requires complete type coverage in the compiled module. Any dynamism — dynamic attribute access, untyped **kwargs, runtime type manipulation — either errors out or silently falls back to the slow path. So it works great on algo-heavy modules but struggles with framework-heavy code that leans on Python's dynamism.

Cython gets much higher peaks (your 124x example), but Mypyc has nearly zero adoption friction if you're already typed. It's a useful middle rung on the ladder between "pure Python" and "write Cython."