|
|
Log in / Subscribe / Register

Python's experimental JIT to be removed

By Joe Brockmeier
October 26, 2026

Python's experimental just-in-time (JIT) compiler, which was added to CPython in 2024 for the 3.13 release, is on its way out. In June, the Python steering council announced that it was pausing work on the JIT in CPython's main branch until there was an accepted Python Enhancement Proposal (PEP) that addressed concerns about maintenance, compatibility, and set clear success metrics as well as a timeline for completion. After creating PEP 836 ("JIT Go Brrr: The Path to a Supported JIT Compiler for CPython") to try to meet the council's request, and after months of discussion, the JIT maintainers have withdrawn the PEP. For now, it appears that development on the once-promising project has come to an end.

The JIT was added to CPython by Brandt Bucher in early 2024. Generally, such a major feature would be expected to land only after the council had approved a standards-track PEP. Bucher had given a talk (YouTube video, slides) about the JIT at a Python core developer sprint, and announced his intent to merge the feature—but he had not taken the step of authoring or submitting a PEP for its approval. He was prodded into doing so by steering council member Thomas Wouters, who was also serving as the release manager for Python 3.13.

Bucher and Savannah Ostrowski drafted PEP 744 ("JIT Compilation"), which was an informational PEP—meaning it only provides information to the Python community and does not represent formal consensus to proceed on a feature or project. LWN covered the discussion of PEP 744 in April 2024, and later covered Bucher's talk on the JIT at PyCon US 2024, as well as the follow-up talk at PyCon US 2025.

PEP it up

Work on the JIT had been proceeding on the basis of PEP 744 until this June, when the council had put forward its formal request for the JIT maintainers to create a standards-track PEP. One might wonder, as Antoine Pitrou did, why the council had decided that it was time to speak up and ask for a new PEP. Wouters said that there was no "single triggering event for this request", but that the council had been discussing the topic for a while and indicated that it was looking to ensure the JIT work did not interfere with other projects. "There's been work trying to get the JIT to play nice with instrumentation, debugging, and profiling. There's also external JITs (like CinderX), JIT-adjacent things (like Numba and PyTorch's compile), and discussions about a tier 3 JIT." The council had waited until after the Python 3.15 beta release "to be clear that we're OK with the status quo for 3.15".

The council asked for a PEP that would make the case for the JIT "as a supported, non-experimental part of CPython: its guarantees, its maintenance commitments, and its impact on redistributors". The council set a deadline of six months for the PEP to be submitted and accepted; failing that, the council would require the JIT code to be removed from the CPython main branch.

Bucher, Ostrowski, and Ken Jin drafted PEP 836 and published it on the Python forum for community feedback on July 3. It generated quite a bit of discussion, some favorable and some critical. One of the key themes in the comments, such as this one by Wouters, and this comment by Mark Shannon, was that the draft felt like it should be two separate PEPs. Shannon, for example, thought that the PEP should only cover goals for accepting the JIT work and felt that it should leave out implementation details. There were also quite a few calls for additional information.

Bucher pushed back a bit on the suggestion that it should be two PEPs, and Ostrowski defended the structure of the PEP as it was. "Outlining goals like we have in the PEP without being able to share the plan and everything we've thought through alongside it would make me uncomfortable. To me, goals without plans behind them aren't really goals at all."

When we last looked at this topic in September, the discussion about the PEP had slowed down without a commitment to develop new PEPs or a formal statement from the council. The last word from the council at that time, in the form of a summary of its August 6 meeting, was that it had met with the PEP authors and was "discussing the state of the PEP and whether it answered the questions the SC asked in its request for a PEP".

Experimentation in main

On September 21, Wouters posted a statement from the steering council, minus Ostrowski (who is currently a member of the steering council but did not participate since she is a co-author of the PEP), that summarized its position. The statement said that PEP did answer all of the questions that were highlighted in the council's request, "although perhaps some less convincingly than others".

The council wished to make clear that it was not looking for the criteria that the JIT should meet to be a supported feature, or whether it should be considered such. Instead, the council was evaluating whether the JIT should continue as an experiment in CPython's main branch.

Part of the problem with allowing experimentation in main is the lack of unified design, and the uncertainty that core developers, package maintainers and users face as the experimentation changes behaviours and API surfaces.

The council said that the PEP was not specific enough about support plans, performance criteria, and too vague or too optimistic about a number of other areas. The statement included a ten-point list of items that the council wanted "to see either spelled out in the PEP, or at least discussed and rejected". The council's list expressed concerns ranging from memory impact to security. For example, on the topic of platform parity, the council wanted to ensure that the JIT was designed to be easily adopted for new platforms. It wanted assurance that the JIT's design would not be tied to specific platform or require platform-specific knowledge to maintain.

Another area that the council called out was user impact. It said that the PEP was "overly optimistic" about user-visible differences with the JIT enabled. There were many cases where users depend on idiosyncrasies in the interpreter design, "as we've seen with other Python implementations or even just between major Python versions", and it wanted clarification on how those differences would be handled. Would they be considered bugs, how would situations be handled if a difference in behavior was unavoidable, and so on.

Security was "an underserved area in the PEP", according to the council; it suggested that a discussion with the Python security response team was in order and that a security review should be part of the criteria for supported status as well.

PEP 836 specified a compatibility review milestone to correspond with the first Python 3.17 release candidate—which would be expected sometime in August 2028—that would involve running the test suites of the top PyPI packages to see if the JIT broke them. The council wanted that timeline moved up significantly. "We think that's way, way too late, and the compatibility review should be an ongoing and continuous process starting as soon as possible".

The council also worried about the JIT's design decisions being made "without critical review by the larger group of developers ultimately responsible for [CPython] development, maintenance and support". The bottom line, it said, was that PEP 836 "mostly answers the questions we asked" with no missing pieces, but it wanted more discussion on those topics so it could "gauge community support and consensus before we're asked to pronounce on this PEP".

Jin replied a few days later to thank the council for its detailed feedback and said that the group would work on its suggestions.

Withdrawn

After some consideration, it appears, the PEP's authors have decided not to continue pursing the council's approval. On October 19, Ostrowski (who is also release manager for Python 3.16 and 3.17) announced that the PEP was being withdrawn:

The Steering Council rightly sets a high bar for a proposal of this scope, and we don't feel we have the personal bandwidth to carry the current version forward. We continue to believe in the technical direction outlined in the PEP, including free-threaded support and a method-based frontend, and remain optimistic about the JIT's potential in CPython. We'll make the reference implementation available and link it from the withdrawn PEP so others who are interested can explore and build on that.

Barry Scott asked if that meant that work on the JIT was stopped. Brett Cannon replied that the work would be stopped in the main repository, but it would be up to the community whether the work would continue elsewhere. Dunc Graham suggested that there might be time for an alternative PEP to be submitted before the council's deadline. Cannon said that was not likely, "as all the people actively driving the JIT were either authors on that PEP or contributors to it".

With the PEP withdrawn, the JIT will likely be removed from CPython main fairly soon to ensure that any problems caused by its removal can be addressed early in the Python 3.16 development cycle. It is unclear whether the original drivers of the JIT work intend to continue working on it at all, or if it will simply be left for others to pick up if there is enough community interest. I have emailed the PEP authors for clarification, but have not yet received a reply.



to post comments

Seems civil

Posted Oct 26, 2026 20:00 UTC (Mon) by jkingweb (subscriber, #113039) [Link] (7 responses)

This reads to me like everyone was civil and acting in good faith and that a problem of process was acknowledged and addressed without acrimony or drama. That's really nice to see, and speaks well of the Python community.

Hopefully this won't be the end of the work, because Python can always benefit from better performance.

Seems civil

Posted Oct 26, 2026 21:54 UTC (Mon) by ballombe (subscriber, #9523) [Link] (6 responses)

What was the advantage over pypy ?

Seems civil

Posted Oct 27, 2026 1:53 UTC (Tue) by acarno (subscriber, #123476) [Link]

For one thing, pypy only suppports Python 3.12, 3.11 and 2.7. More significantly, pypy isn't CPython - it's an alternative implementation that is mostly compatible but with a few noticeable differences (the pypy website lists these). This would have added a JIT to CPython (the reference implementation) directly, meaning all new Python versions - and all included modules, etc. - get access to JIT compilation. In the PEP 836 authors' own words:

Alternative Python implementations, such as PyPy and GraalPy, demonstrate that larger speedups are possible for some Python programs, and we deeply value those projects. However, many users cannot adopt an alternative runtime even when it may perform better on their code due to factors such as supported Python versions, extension compatibility, embedding requirements, deployment constraints, and tooling support.

Seems civil

Posted Oct 27, 2026 14:15 UTC (Tue) by markkitt (guest, #181598) [Link] (4 responses)

Pypy is in low maintenance mode.

Seems civil

Posted Oct 27, 2026 14:45 UTC (Tue) by LtWorf (subscriber, #124958) [Link] (2 responses)

If they had the same amount of funding cPython has…

Seems civil

Posted Oct 28, 2026 14:25 UTC (Wed) by zahlman (guest, #175387) [Link]

Python isn't on the same level of funding as Mozilla or Linux, but they do get a pretty significant amount, true.

But as far as I can tell, the large majority of it goes to PyCon operating expenses (and the large majority of it comes from PyCon admission fees).

Seems civil

Posted Oct 29, 2026 8:02 UTC (Thu) by ceplm (subscriber, #41334) [Link]

It's a vicious cycle: enterprise will support it, if there is a long-term production value for them (stress on “long-term”), without enterprise support there is no hope to achieve the required level of stability and maintainability. Any resolution of this conundrum would lead to riches, but nobody found one yet.

Seems civil

Posted Oct 28, 2026 11:43 UTC (Wed) by bobpaul (guest, #187396) [Link]

It's actively developed. Pypy recently added Python 3.12 support. That's only 3 releases behind CPython.

Experimentation in main?

Posted Oct 27, 2026 12:26 UTC (Tue) by marcH (subscriber, #57642) [Link] (3 responses)

> Experimentation in main

Apologies if I missed it: why was this happening in the main branch? Too many conflicts with other changes also happening in main? (Not enough to justify IMHO but that could explain)

> [a compatibility review] that would involve running the test suites of the top PyPI packages to see if the JIT broke them. The council wanted that timeline moved up significantly. "We think that [Aug. 2028] is way, way too late, and the compatibility review should be an ongoing and continuous process starting as soon as possible".

Maybe I'm missing something again but that seems normal and expected for the main branch - even when not enabled by default.

I didn't experience it much personally but regressions (in main releases) sound like a relatively frequent complaint about Python...

Experimentation in main?

Posted Oct 27, 2026 12:46 UTC (Tue) by mathstuf (subscriber, #69389) [Link] (1 responses)

I think it is possible, but the use needs to have a signal that the user knows they're "playing with fire". The way we do this for CMake is that there is a variable which needs to be set to a specified value (a randomly generated UUID) for the experiment to become "active" (and its first usage will trigger a warning about it becoming active). If the value is not correct, the feature is ignored. We then change the expected value whenever we update the behavior. With that, projects can't use the "but the value worked last time!" excuse. Basically, we use it as a way to escape Hyrum's Law and committing to any in-progress behavior in the future.

Experimentation in main?

Posted Oct 27, 2026 17:52 UTC (Tue) by marcH (subscriber, #57642) [Link]

Regularly changing the UUID is really cool, this sort of "light-weight branching" is smart! Perfect for letting any user help with testing.

However I can imagine a JIT implementation being "invasive" enough that it "leaks" some changes outside the scope of such an experimental flag. So that technique could still not be completely bullet proof in such a case (it should still be known and used).

The devil is always in the details...

Experimentation in main?

Posted Oct 27, 2026 16:11 UTC (Tue) by danilo (guest, #57549) [Link]

I would say that it was mostly accidental "whoopsie" of allowing active, core contributors to basically side-step the usual process for architectural changes such as this one. Board — once they realised — acted amicably to put things in order, but by that time, JIT work has slowed down sufficiently that it depended on a few contributors with limited bandwidth and they could not commit to address all the concerns and put things back on track.

one problem is Python itself

Posted Oct 27, 2026 21:58 UTC (Tue) by roc (subscriber, #30627) [Link] (12 responses)

An underlying problem here seems to be that writing a proper JIT for Python is incredibly hard and the performance gains are pretty small. If the JIT was a runaway success presumably getting the paperwork right would have been less important or at least more people would have helped.

one problem is Python itself

Posted Oct 28, 2026 0:09 UTC (Wed) by jch (guest, #51929) [Link] (11 responses)

> writing a proper JIT for Python is incredibly hard

Harder than for JavaScript? Ruby? Lua? Smalltalk? We've got fine JITs for all of these languages, and they are just as dynamic as Python.

one problem is Python itself

Posted Oct 28, 2026 1:11 UTC (Wed) by raven667 (subscriber, #5198) [Link]

I don't have any particular insight into the Python internals, but I think the fact that CPython doesn't have a JIT after all these years and all the available developer hours put into maintenance and features is strong (but anecdotal) evidence that it's harder than it looks to build a JIT that is compatible with the runtime and the way it's used/embedded/extended.

one problem is Python itself

Posted Oct 28, 2026 4:59 UTC (Wed) by admalledd (subscriber, #95347) [Link] (5 responses)

> Harder than for JavaScript? Ruby? Lua? Smalltalk?

Yes actually, see Python (the language) has had JITs in various flavors (pypy, etc) for a while, and all the JITs for JS/Lua/Ruby (can't speak for Smalltalk's JIT evolution but probably similar) are like those non cPython JITs: they didn't have to worry about c-abi compatibility. Especially JS, there was never any native code modules to worry about linking to. Yes, nowdays you can write LuaJIT or node.js or .. native modules, but note those are also all runtime/implementation specific.

cPython has been trying for a long time to "have its cake and eat it too" in that any JIT they add needs to have minimal impact on c/binary/native modules. That is the key that makes "JIT for Python incredibly hard". None of the alternate python implementations got enough traction to really replace cPython as "the defacto home/standard bearer", unlike for JS which got V8 (for 'quite the while', yes other JS JIT runtimes now also exist but binary module compat is not kept), and LuaJIT had breaking changes especially around the debug module and such for a long time, etc.

Honestly, I don't know if cPython should even bother with JIT/perf that much anymore considering the amount of incomplete efforts, though I know this specific effort is by far the closest (and is likely to return). Since the whole P3K conversion era, there are so many more options for writing "performant psudo code", though I get some people vastly prefer Python so *shrug*.

one problem is Python itself

Posted Oct 28, 2026 7:37 UTC (Wed) by fw (subscriber, #26023) [Link] (3 responses)

Yes actually, see Python (the language) has had JITs in various flavors (pypy, etc) for a while, and all the JITs for JS/Lua/Ruby (can't speak for Smalltalk's JIT evolution but probably similar) are like those non cPython JITs: they didn't have to worry about c-abi compatibility.

LuaJIT provides excellent C ABI compatibility (with Lua 5.1, but that's another story). It's essentially a drop-in replacement. There are other examples, like how Java JNI remained compatible across many iterations of the Hotspot JIT compiler and its many, extremely varied garbage collectors (and other niceties, like run-time-configurable pointer sizes). The main difference to the Python situation is that in these other cases, the API designers had the foresight not hand out raw pointers to language-defined objects via the C API. This means that the internals remained internals and could evolve independently from the extension modules.

That being said, I think the importance of C extensions compatibility and the reference-counting is a bit overblown these days. Surely it would be possible to auto-convert extensions by now? There must be many use cases where this is good enough. I expect that just by eliminating reference counting and bytecode dispatch overhead, a decent speedup is possible, without creating a real, profiling-driven JIT compiler.

one problem is Python itself

Posted Oct 28, 2026 10:18 UTC (Wed) by koflerdavid (subscriber, #176408) [Link] (1 responses)

> That being said, I think the importance of C extensions compatibility and the reference-counting is a bit overblown these days. Surely it would be possible to auto-convert extensions by now? There must be many use cases where this is good enough. I expect that just by eliminating reference counting and bytecode dispatch overhead, a decent speedup is possible, without creating a real, profiling-driven JIT compiler

CPython is currently stabilizing its new free-threading mode. The current budget for changes to the whole module ecosystem is therefore already strained. It's simply bad timing for other breaking changes to land since it blow up the test matrix too much.

one problem is Python itself

Posted Oct 28, 2026 11:10 UTC (Wed) by fw (subscriber, #26023) [Link]

Oh, indeed, I doubt CPython is the right place to experiment with something like that, considering that the changes required are pretty drastic. If people like the benefits, there could be reasons to figure out integration, but I don't think it's the right starting point.

one problem is Python itself

Posted Oct 28, 2026 12:42 UTC (Wed) by jch (guest, #51929) [Link]

> in these other cases, the API designers had the foresight not hand out raw pointers to language-defined objects via the C API. This means that the internals remained internals and could evolve independently from the extension modules.

Thanks to all of you for the explanations, that makes perfect sense.

one problem is Python itself

Posted Oct 30, 2026 15:07 UTC (Fri) by marcH (subscriber, #57642) [Link]

> cPython has been trying for a long time to "have its cake and eat it too" in that any JIT they add needs to have minimal impact on c/binary/native modules. [...]
> Honestly, I don't know if cPython should even bother with JIT/perf that much anymore considering the amount of incomplete efforts, though I know this specific effort is by far the closest (and is likely to return). Since the whole P3K conversion era, there are so many more options for writing "performant psudo code", though I get some people vastly prefer Python so *shrug*.

"more options" like for instance delegating critical paths to other, less dynamic and faster languages like "numpy" and others do[*]? Thanks to cPython's C API? Which means "performance problems solved" for most users?

It's always been a pain combining different languages, especially one with garbage collection and one with none. BUT, if that impedance mismatch problem has been successfully solved for cPython specifically (Has it? Genuine question) then why bother with a JIT indeed?

[*] quoting https://developer.nvidia.com/cuda/python
> As of CUDA 13.3, CUDA Python and C++ now stand as equal first-class citizens, with NVIDIA aiming to maintain feature-complete parity going forward.

one problem is Python itself

Posted Oct 28, 2026 11:43 UTC (Wed) by pkkm (guest, #187395) [Link] (2 responses)

> Harder than for JavaScript? Ruby? Lua? Smalltalk?

Yes, absolutely, because of CPython's C API. Instead of using opaque handles, it exposes pointers directly to the interpreter's data structures, plus many other implementation details. Any JIT has to either drop compatibility with the API, resulting in poor adoption; forgo many of the best optimizations like tagged pointers, resulting in disappointing speed gains; or emulate the API on demand, resulting in a very uneven performance profile depending on what extensions are used.

There have been attempts to fix the situation, like HPy, but they seem to stall out because it's a chicken-and-egg problem. The C API would have to be redesigned and extensions rewritten first, and the optimization work that relies on opaque handles would only start years later.

one problem is Python itself

Posted Oct 30, 2026 9:07 UTC (Fri) by anton (subscriber, #25547) [Link] (1 responses)

An uneven performance profile should be expected for any kind of JIT compilation, even with a more performance-friendly C API. Of course, in the latter case, more coding practices would benefit, but there would still be coding practices that remain slow.

That's of course not as nice as one would like, but I don't think it's a long-term problem. Programmers would learn and disseminate knowledge about what practices are slow (including a large amount of pseudo-knowledge), and would avoid the slow practices, at least for projects where performance is important. Language designers would include fast alternatives for the slow practices, and programmers would eventually make use of them.

one problem is Python itself

Posted Nov 2, 2026 8:37 UTC (Mon) by pkkm (guest, #187395) [Link]

By "uneven performance profile" I didn't mean the normal unevenness of a JIT, but specifically the cost of emulating the C API on demand. There's a big slowdown when Python data touches a C extension, as the runtime is forced to translate from its own optimized representations to CPython-like data structures with CPython-like memory management. For example, PyPy can run pure-Python code at multiples of CPython's speed, but using C extensions reduces the gains or even makes it slower than CPython. PyPy core dev Antonio Cuni explains the challenges here: https://pypy.org/posts/2018/09/inside-cpyext-why-emulatin...

one problem is Python itself

Posted Oct 28, 2026 20:37 UTC (Wed) by riking (subscriber, #95706) [Link]

Harder than Lua? Certainly, yes.

GIL won overt JIT

Posted Oct 28, 2026 19:15 UTC (Wed) by xnox (subscriber, #63320) [Link]

I did question why there are both no-GIL and JIT work, and what's the long-term future.

It seems like the no-GIL won; and JIT is not performant enough to stay.

And we see that people who need speed have been reaching out for other languages like fortran, c++, rust and using compiled extensions which is the best kind of JIT - the one that is compiled ahead of time.


Copyright © 2026, Eklektix, Inc.
This article may be redistributed under the terms of the Creative Commons CC BY-SA 4.0 license
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds