October 17th, 2024

Python 3.12 vs. Python 3.13 – performance testing

Python 3.13 outperforms Python 3.12 with a 1.08x improvement in benchmarks, especially in async tests, though some areas like coverage showed decreased performance. It is recommended for better performance.

Read original articleLink Icon
Python 3.12 vs. Python 3.13 – performance testing

The performance testing of Python 3.13 compared to Python 3.12 was conducted using 100 benchmark tests on systems equipped with AMD Ryzen 7000 series and 13th-generation Intel Core processors. The tests utilized the pyperformance 1.11.0 library on Windows 11. Results indicated that Python 3.13 generally outperformed Python 3.12, achieving a geometric mean performance improvement of 1.08x across various benchmarks. Notable improvements were observed in tests such as async_tree_eager_io_tg (1.61x faster) and async_tree_io_tg (1.54x faster). However, some benchmarks showed decreased performance, particularly in coverage (1.36x slower) and create_gc_cycles (1.13x slower). The performance results were also categorized by benchmark groups, with Python 3.13 showing improvements in apps (1.06x faster), asyncio (1.22x faster), and math (1.07x faster), while startup performance was slightly slower (1.04x). The second part of the testing on an Intel Core i3-1315U processor yielded similar results, with significant speedups in async_tree_cpu_io_mixed (1.27x faster) and async_tree_eager_io (1.40x faster), although some tests like coverage were notably slower (3.85x). Overall, Python 3.13 demonstrates enhanced performance in many areas, making it a favorable upgrade over Python 3.12.

- Python 3.13 shows an overall performance improvement of 1.08x over Python 3.12.

- Significant speedups were noted in async-related benchmarks.

- Some benchmarks, particularly coverage, experienced performance drops.

- Performance improvements were consistent across both AMD and Intel processors.

- Python 3.13 is recommended for users seeking better performance in various applications.

Link Icon 7 comments
By @serjester - 7 months
Not much to talk about - asyncio is 20% faster and everything else is basically the same. Props to the op for doing the benchmark though. Surprising re is 4% slower - I was under the impression python just wraps the c bindings.
By @ComputerGuru - 7 months
Site is exceeding its traffic allotment. I had to try a few times but I was able to snag a copy for the archives.

https://archive.is/FBDVL

By @pama - 7 months
It appears that the site is now popular—I’m getting:

Resource Limit Is Reached

The website is temporarily unable to service your request as it exceeded resource limit. Please try again later.

By @VeejayRampay - 7 months
so basically performance doesn't really go up or down, it's the same

that's good news since 3.13 is merely planting the seeds for further improvements, can't wait for 3.14 and 3.15

By @throw0101d - 7 months
The "x" numbers are not quite correct, e.g.:

    2to3 226 ms 217 ms (1.04x faster)
It is not "1.04x" faster, which would mean 104%, or twice as fast / half the time. It is 4% faster.