Serdar Yegulalp
Senior Writer

Microsoft Pyjion boosts Python speed

news analysis
Jan 29, 20162 mins

The new JIT technology for Python is backward-compatible and works directly with CPython extension modules

car race speed fastlane winning
Credit: Thinkstock

A new open source Microsoft project, Pyjion, improves the Python language’s speed by augmenting its stock interpreter with a JIT derived from Microsoft’s CoreCLR project.

Python’s standard-issue runtime, CPython, only interprets the bytecode of Python apps and does not accelerate by compiling the code in any way. One common method to speed up Python is to replace CPython entirely. PyPy, a popular CPython replacement, employs a JIT compiler to accelerate Python applications.

PyPy provides a hefty speed boost to many applications, but not all of them, and it sometimes even delivers worse performance than CPython. It also doesn’t have the best support for CPython extension modules, which are widely used in Python applications like scientific computing; thus, some of the most avid Python users can’t leverage PyPy at all.

Pyjion takes a different approach. It adds a JIT API to CPython, so multiple JITs can be plugged directly into CPython. Since CPython is still in use, apps run as normal, including those that rely on extension modules.

Also, Pyjion targets Python 3, where other Python-acceleration projects have largely favored Python 2. PyPy supports Python 3, but only Python 3.2, so many language constructions added since then (such as <a href="/article/2252087/python-35-builds-on-strengths-and-borrows-from-go.html">async/await</a>) won’t work.

Microsoft claims Pyjion’s approach is more flexible, since the JIT component is treated a pluggable resource. The choice of a JIT based on CoreCLR isn’t meant to be the only option, but rather it serves as a proof-of-concept. According to the documentation on GitHub, Microsoft hopes this will “lead to a proliferation of JIT runtimes for Python, allowing people to choose a JIT that best fits their workload.”

Microsoft contributes to existing open source projects via mostly indirect support of its own efforts. Its contributions to the Linux kernel, for instance, were mainly about making Linux a first-class citizen in Azure. But its language work has been slightly more open-ended, and if Pyjion finds traction it’ll be one of the biggest contributions Microsoft has made to the ecosystem of a language it previously had no direct hand in.

Serdar Yegulalp

Serdar Yegulalp is a senior writer at InfoWorld. A veteran technology journalist, Serdar has been writing about computers, operating systems, databases, programming, and other information technology topics for 30 years. Before joining InfoWorld in 2013, Serdar wrote for Windows Magazine, InformationWeek, Byte, and a slew of other publications. At InfoWorld, Serdar has covered software development, devops, containerization, machine learning, and artificial intelligence, winning several B2B journalism awards including a 2024 Neal Award and a 2025 Azbee Award for best instructional content and best how-to article, respectively. He currently focuses on software development tools and technologies and major programming languages including Python, Rust, Go, Zig, and Wasm. Tune into his weekly Dev with Serdar videos for programming tips and techniques and close looks at programming libraries and tools.

More from this author