Dropbox Opens Pyston: A JIT Python Implementation
Dropbox has announced Pyston, a new open-source Python implementation under development. The project's goal is to create a high-performance Python runtime capable of competing with traditional systems languages like C++.
The motivation comes from Dropbox's own scaling challenges. As the company's workloads grow, meeting performance targets in Python has become increasingly difficult, sometimes pushing teams toward rewrites in other languages. Rather than accept that trade-off, the team began exploring JIT-based approaches, drawing inspiration from the JavaScript ecosystem—particularly Chrome's V8 engine, which has significantly raised the performance ceiling for JavaScript.
Why Build a New Implementation?
Python already has JIT-capable implementations. PyPy uses a tracing JIT with notable success, and Jython and IronPython sit atop mature VMs with substantial JIT support. But Dropbox argues that the most promising techniques can't simply be grafted onto these existing projects.
The key divergence is JIT architecture. JavaScript has largely moved from tracing JITs to method-at-a-time JITs because of performance advantages. It's unclear whether that benefit transfers to Python, but the two JIT approaches are fundamentally incompatible—settling the question requires a fresh implementation built around a method-at-a-time design.
Pyston also plans to use a conservative garbage collector specifically to support extension modules efficiently. This choice is integral to the JIT's design, making it impractical to evaluate experimentally within an existing implementation.
Starting from scratch carries obvious costs—a new language implementation is a massive undertaking. Pyston mitigates that by building on LLVM, which provides high-quality code generation without reinventing the backend. Still, Pyston is nowhere near production-ready.
How Pyston Works
Pyston takes parsed Python code and lowers it to LLVM intermediate representation (IR). The IR goes through LLVM's optimizer and then to the LLVM JIT engine, producing executable machine code. LLVM's extensive optimization passes are a central advantage.
The fundamental problem is that LLVM can't reason about Python semantics—all low-level behavior is hidden behind dynamic type dispatch. Pyston addresses this with type speculation. While it's generally impossible to prove a variable's type statically, Pyston makes educated predictions about object types, then verifies them at runtime by branching between a fast path (prediction correct) and a slow path (prediction fails).
Additional techniques include hidden classes for faster attribute lookups and inline caches for method calls. More technical details are available on the project's GitHub page.
Current Status
Pyston is at an early stage, supporting only a minimal subset of Python. Benchmark numbers aren't meaningful yet—the implementation can't run a representative set of benchmarks, and some runtime features that would introduce slowdowns aren't yet implemented, so comparisons wouldn't be apples-to-apples. With those caveats, Pyston generally outperforms CPython but trails PyPy.
The code is available on GitHub under the Apache 2.0 license, accompanied by growing technical documentation. The project is open to collaboration, and Dropbox is actively hiring for the effort.



