VOOZH about

URL: https://thenewstack.io/python-3-13-blazing-new-trails-in-performance-and-scale/

⇱ Python 3.13: Blazing New Trails in Performance and Scale - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2024-10-07 11:21:07
Python 3.13: Blazing New Trails in Performance and Scale
Programming Languages / Python / Software Development

Python 3.13: Blazing New Trails in Performance and Scale

Python 3.13 introduces experimental free-threaded mode and JIT compiler, paving the way for improved performance and multi-core utilization while enhancing the interactive experience.
Oct 7th, 2024 11:21am by Darryl K. Taft and Joab Jackson
👁 Featued image for: Python 3.13: Blazing New Trails in Performance and Scale
Featured image via Unsplash.

Python 3.13, expected to be released today, represents a significant step forward for the Python programming language, particularly in terms of performance and developer experience, with the experimental free-threaded mode and just-in-time (JIT) compiler laying groundwork for future improvements.

Initially scheduled for release on Oct. 1, the new release was delayed because of a performance regression and the publication date for the latest stable release of Python was moved to Oct. 7.

As noted, some of the major changes to Python include a new interactive interpreter, as well as experimental support for running in a free-threaded mode and a JIT compiler.

Free Threading

The experimental free-threaded CPython feature allows running with the Global Interpreter Lock (GIL) disabled. It requires a separate executable and can be installed via official Windows and macOS installers or built from source. It enables full utilization of multicore processors. And it currently takes a performance hit for single-threaded operations.

“Free threading is an attempt to remove the Global Interpreter Lock from CPython, which has traditionally been the biggest obstacle to achieving thread-based parallelism when performing CPU-bound tasks,” wrote Bartosz Zaczyński, a content creator at Real Python, in an article. “In short, the GIL allows only one thread of execution to run at any given time, regardless of how many cores your CPU is equipped with. This prevents Python from leveraging the available computing power effectively.”

Historically, Python’s GIL prevented true concurrent execution of threads, Stanley Seibert, senior director of Community Innovation at Anaconda, told The New Stack. However, the new experimental feature in Python 3.13 allows for concurrent execution of pure Python code. The feature aims to better utilize multicore processors without sacrificing single-thread performance. It will be turned off by default in this release due to its experimental nature. The feature was developed by Meta engineers and approved by Python’s steering committee. Anaconda is working on test packages for the community to try out this feature, Seibert said.

JIT Compiler

Meanwhile, “Up to now, you could take advantage of various JIT compilers for Python through external tools and libraries only,” wrote Zaczyński. “Some of them, like PyPy and Pyjion, offered more or less general-purpose JIT compilers, while others, such as Numba, focused on specific use cases like numerical computation.”

The new experimental JIT compiler in Python 3.13 uses a fairly recent algorithm named copy-and-patch, he wrote.

“The basic idea behind this compilation technique boils down to finding a suitable template with pre-compiled machine code for the target CPU and filling it with the missing information, such as memory addresses of variables,” he noted in his article.

Zaczyński added that the long-term plan is to enhance Python’s JIT to the point where it actually makes a noticeable difference in code execution performance without taking much additional memory.

Brad Shimmin, an analyst at Omdia, called the JIT compiler “a huge deal,” as it puts Python on a more even footing opposite storied and enterprise-focused JIT-based languages like Java.

“More than that, this JIT implementation introduces a performance improvement over traditional JIT architectures,” he told The New Stack. “Rather than walking code through an intermediate language before creating machine code can be pretty slow, Python 13.3’s implementation uses a copy-and-patch approach that doesn’t require the full JIT to run inside the Python runtime.”

Andrew Cornwall, an analyst at Forrester Research, agrees that the two most significant runtime changes in Python 3.13 are experimental, “so everyday CPython users won’t see much difference yet,” he told The New Stack. However, Python is laying the groundwork for faster code running on multiple processors.

“A JIT compiler should make CPython run faster for everyone once enabled, but Python is being conservative and leaving it off by default for now,” Cornwall said. Yet, “The ability to disable the global interpreter lock could be more disruptive, by allowing Python libraries to take advantage of more cores if the libraries can support multithreading. Those developing C libraries will need to investigate the effects of disabling the GIL. However, for everyday users those changes are further away — they’re in a separate python3.13t binary for now.”

Free threading is about trying to use more cores. Yet, “the JIT compilation is about trying to get more out of the single core just by making the interpreter more efficient,” Seibert told The New Stack. “This release will include the first version of that JIT compiler, and that will just the goal is for that to just invisibly make everything faster.”

Indeed, there’s been a multiyear focus on speed for Python, Seibert said. “I know historically Python’s been slower but easier to program [than some other languages]. This [JIT compiler] kind of brings it into the realm of like C or C++,” he said.

Interactive Interpreter Improvements

Meanwhile, the improved interactive interpreter features multiline editing with history preservation, direct support for read–eval–print loop (REPL)-specific commands including help, exit, and quit, color-enabled prompts and tracebacks by default, interactive help browsing (F1 key), history browsing (F2 key), and “paste mode” for easier code pasting (F3 key).

“There’s a new interactive interpreter that adds some quality of life things, like coloring and being able to edit multiple lines of Python code at the same time — stuff that you could have done with IPython, but now it’s built into the interpreter,” Seibert said.

Python’s new interactive shell, available by default, is based on code from the PyPy project.

Other Key Changes

Moreover, Python 3.13 has an incremental garbage collector implementation that reduces long pauses when cleaning up allocated memory, Cornwall said.

In addition, “Platform support now includes mobile devices (iOS and Android are both at tier 3, meaning there’s at least one core developer involved). And Wasm support has moved from emscripten to WASI,” he said.

More Improvements Under the Hood

Also, “There are a few deprecated libraries — if you’re using cgi or crypt, for instance, you’ll need to find alternatives,” Cornwall told The New Stack. “Language changes are not likely to bite most users. Previously undefined semantics around locals() have now been defined, but that’s in the weeds for most developers. With this release, most developers will notice the new paint job but not the significant changes under the hood.”

One such developer who has noticed changes under the hood is Tom Tang, an engineer at Distributive, the creator of the PythonMonkey project. Tang is a core developer for the PythonMonkey project and is currently working on bringing Python 3.13 support to PythonMonkey.

API Stability: PythonMonkey Example

Tang said he has a different perspective as a systems developer who works deeply with the lower-level parts of Python, so the change of C API stability in Python 3.13 is one thing worth noticing.

Prior to version 3.13, Python’s C API changed frequently in every minor version, and there were plenty of undocumented internal APIs that were either broken or removed in every next Python release, Tang told The New Stack.

“This causes some troubles for us developing PythonMonkey, as PythonMonkey is promised to support multiple Python versions, and it’s very complicated. In Python 3.13, the CPython core maintainers made a move to address the API instability issue by making only stable public APIs available for use. Most of the undocumented ‘private’ APIs are removed in Python 3.13, and the remaining few are now documented and promoted to stable APIs.”

This move is important for Python extension developers as it lets you stay with the well-documented APIs, and forces you to really think about back and forward compatibility when dealing with the lower parts of Python, Tang said.

“On the other hand in the case of PythonMonkey, since we are dealing with very niche implementation details in the CPython interpreter to make PythonMonkey as fast and efficient as possible, hiding away the ‘internal APIs’ or the implementation details may have closed doors for us to further optimize PythonMonkey towards a faster cross-language runtime,” he said.

Besides, “It would be helpful to deeply integrated products like PythonMonkey if there were a more formalized API for accessing internals, even if these became part of an ‘unstable’ API,” Tang said.

Do It All and Do It Well

Overall, the changes in Python 3.13 “are nice additions that in themselves will further solidify Python as a ‘go-to’ language within existing use cases, particularly for data, AI, and IT engineers,” Shimmin said. “However, to me, the most defining aspect of this release revolves around speed and scale.”

The attention the Python community is paying to performance and efficiency will, of course, solve some of Python’s current growing pains around performance. The updates in Python 3.13 “will also better secure Python’s reputation as a ‘do it all and do it well’ language across a broader range of use cases,” Shimmin said.

TRENDING STORIES
Darryl K. Taft covers DevOps, software development tools and developer-related issues from his office in the Baltimore area. He has more than 25 years of experience in the business and is always looking for the next scoop. He has worked...
Read more from Darryl K. Taft
Joab Jackson is a senior editor for The New Stack, covering cloud native computing and system operations. He has reported on IT infrastructure and development for over 30 years, including stints at IDG and Government Computer News. Before that, he...
Read more from Joab Jackson
SHARE THIS STORY
TRENDING STORIES
TNS owner Insight Partners is an investor in: Real, Anaconda.
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.