Rune Hansén Steinnes
The comfy chair

The comfy chair

Python 3.11

The need for speed.. Python 3.11 is out and it's fast!

Rune Hansén Steinnes's photo
Rune Hansén Steinnes
·Jul 13, 2022·

5 min read

I let the benchmark churn away while reading mail and browsing the web so it might not have been optimal conditions.

+-------------------------+---------+-----------------------+
| Geometric mean          | (ref)   | 1.41x faster          |
+-------------------------+---------+-----------------------+
                         .',;::::;,'.                roderik@genabackis 
         .';:cccccccccccc:;,.            ------------------ 
      .;cccccccccccccccccccccc;.         OS: Fedora Linux 36 (Workstation Edition) x86_64 
    .:cccccccccccccccccccccccccc:.       Host: XPS 15 9560 
  .;ccccccccccccc;.:dddl:.;ccccccc;.     Kernel: 5.19.16-200.fc36.x86_64 
 .:ccccccccccccc;OWMKOOXMWd;ccccccc:.    Uptime: 41 mins 
.:ccccccccccccc;KMMc;cc;xMMc:ccccccc:.   Packages: 2281 (rpm), 33 (flatpak) 
,cccccccccccccc;MMM.;cc;;WW::cccccccc,   Shell: zsh 5.8.1 
:cccccccccccccc;MMM.;cccccccccccccccc:   Resolution: 1920x1080 
:ccccccc;oxOOOo;MMM0OOk.;cccccccccccc:   DE: GNOME 42.5 
cccccc:0MMKxdd:;MMMkddc.;cccccccccccc;   WM: Mutter 
ccccc:XM0';cccc;MMM.;cccccccccccccccc'   WM Theme: Adwaita 
ccccc;MMo;ccccc;MMW.;ccccccccccccccc;    Theme: Adwaita [GTK2/3] 
ccccc;0MNc.ccc.xMMd:ccccccccccccccc;     Icons: Adwaita [GTK2/3] 
cccccc;dNMWXXXWM0::cccccccccccccc:,      Terminal: gnome-terminal 
cccccccc;.:odl:.;cccccccccccccc:,.       CPU: Intel i7-7700HQ (8) @ 3.800GHz 
:cccccccccccccccccccccccccccc:'.         GPU: NVIDIA GeForce GTX 1050 Mobile 
.:cccccccccccccccccccccc:;,..            GPU: Intel HD Graphics 630 
  '::cccccccccccccc::;,.                 Memory: 5810MiB / 15833MiB

Pyperformance run in podman containers (thanks to towardsdatascience.com/python-is-about-to-b..)

$ podman run -t -d python:3.11
$ podman exec -it pedantic_bhaskara /bin/bash
$ python -m pip install pyperformance
$ pyperformance run -o py311.json

... and the same for python 3.10

The result:

+-------------------------+---------+-----------------------+
| Benchmark               | py310   | py311-prime           |
+=========================+=========+=======================+
| 2to3                    | 365 ms  | 279 ms: 1.31x faster  |
+-------------------------+---------+-----------------------+
| chameleon               | 9.92 ms | 6.99 ms: 1.42x faster |
+-------------------------+---------+-----------------------+
| chaos                   | 119 ms  | 71.6 ms: 1.66x faster |
+-------------------------+---------+-----------------------+
| crypto_pyaes            | 137 ms  | 76.8 ms: 1.78x faster |
+-------------------------+---------+-----------------------+
| deltablue               | 8.79 ms | 4.00 ms: 2.20x faster |
+-------------------------+---------+-----------------------+
| django_template         | 56.2 ms | 35.4 ms: 1.59x faster |
+-------------------------+---------+-----------------------+
| dulwich_log             | 110 ms  | 84.7 ms: 1.30x faster |
+-------------------------+---------+-----------------------+
| fannkuch                | 539 ms  | 407 ms: 1.32x faster  |
+-------------------------+---------+-----------------------+
| float                   | 121 ms  | 83.1 ms: 1.45x faster |
+-------------------------+---------+-----------------------+
| genshi_text             | 31.4 ms | 22.9 ms: 1.37x faster |
+-------------------------+---------+-----------------------+
| genshi_xml              | 71.3 ms | 55.4 ms: 1.29x faster |
+-------------------------+---------+-----------------------+
| go                      | 246 ms  | 143 ms: 1.72x faster  |
+-------------------------+---------+-----------------------+
| hexiom                  | 9.72 ms | 7.38 ms: 1.32x faster |
+-------------------------+---------+-----------------------+
| html5lib                | 96.9 ms | 68.5 ms: 1.42x faster |
+-------------------------+---------+-----------------------+
| json_dumps              | 16.1 ms | 13.0 ms: 1.24x faster |
+-------------------------+---------+-----------------------+
| json_loads              | 29.8 us | 25.7 us: 1.16x faster |
+-------------------------+---------+-----------------------+
| logging_format          | 10.6 us | 7.59 us: 1.40x faster |
+-------------------------+---------+-----------------------+
| logging_silent          | 177 ns  | 103 ns: 1.72x faster  |
+-------------------------+---------+-----------------------+
| logging_simple          | 9.58 us | 6.87 us: 1.39x faster |
+-------------------------+---------+-----------------------+
| mako                    | 17.2 ms | 11.8 ms: 1.46x faster |
+-------------------------+---------+-----------------------+
| meteor_contest          | 120 ms  | 109 ms: 1.10x faster  |
+-------------------------+---------+-----------------------+
| nbody                   | 139 ms  | 98.5 ms: 1.41x faster |
+-------------------------+---------+-----------------------+
| nqueens                 | 110 ms  | 90.3 ms: 1.22x faster |
+-------------------------+---------+-----------------------+
| pathlib                 | 27.6 ms | 25.7 ms: 1.08x faster |
+-------------------------+---------+-----------------------+
| pickle                  | 11.3 us | 10.7 us: 1.06x faster |
+-------------------------+---------+-----------------------+
| pickle_dict             | 31.1 us | 30.5 us: 1.02x faster |
+-------------------------+---------+-----------------------+
| pickle_list             | 4.77 us | 4.01 us: 1.19x faster |
+-------------------------+---------+-----------------------+
| pickle_pure_python      | 474 us  | 315 us: 1.50x faster  |
+-------------------------+---------+-----------------------+
| pidigits                | 202 ms  | 196 ms: 1.03x faster  |
+-------------------------+---------+-----------------------+
| pyflate                 | 703 ms  | 444 ms: 1.58x faster  |
+-------------------------+---------+-----------------------+
| python_startup          | 12.5 ms | 11.2 ms: 1.12x faster |
+-------------------------+---------+-----------------------+
| python_startup_no_site  | 8.20 ms | 8.44 ms: 1.03x slower |
+-------------------------+---------+-----------------------+
| raytrace                | 607 ms  | 306 ms: 1.99x faster  |
+-------------------------+---------+-----------------------+
| regex_compile           | 229 ms  | 142 ms: 1.61x faster  |
+-------------------------+---------+-----------------------+
| regex_dna               | 262 ms  | 199 ms: 1.32x faster  |
+-------------------------+---------+-----------------------+
| regex_effbot            | 3.89 ms | 3.35 ms: 1.16x faster |
+-------------------------+---------+-----------------------+
| regex_v8                | 29.9 ms | 22.8 ms: 1.31x faster |
+-------------------------+---------+-----------------------+
| richards                | 89.8 ms | 46.3 ms: 1.94x faster |
+-------------------------+---------+-----------------------+
| scimark_fft             | 483 ms  | 315 ms: 1.53x faster  |
+-------------------------+---------+-----------------------+
| scimark_lu              | 195 ms  | 117 ms: 1.67x faster  |
+-------------------------+---------+-----------------------+
| scimark_monte_carlo     | 124 ms  | 67.1 ms: 1.85x faster |
+-------------------------+---------+-----------------------+
| scimark_sor             | 238 ms  | 120 ms: 1.99x faster  |
+-------------------------+---------+-----------------------+
| scimark_sparse_mat_mult | 6.27 ms | 4.66 ms: 1.35x faster |
+-------------------------+---------+-----------------------+
| spectral_norm           | 177 ms  | 102 ms: 1.73x faster  |
+-------------------------+---------+-----------------------+
| sqlalchemy_declarative  | 229 ms  | 147 ms: 1.56x faster  |
+-------------------------+---------+-----------------------+
| sqlalchemy_imperative   | 34.1 ms | 21.0 ms: 1.63x faster |
+-------------------------+---------+-----------------------+
| sqlite_synth            | 3.80 us | 2.61 us: 1.45x faster |
+-------------------------+---------+-----------------------+
| sympy_expand            | 721 ms  | 503 ms: 1.43x faster  |
+-------------------------+---------+-----------------------+
| sympy_integrate         | 32.0 ms | 22.4 ms: 1.43x faster |
+-------------------------+---------+-----------------------+
| sympy_sum               | 256 ms  | 187 ms: 1.37x faster  |
+-------------------------+---------+-----------------------+
| sympy_str               | 429 ms  | 311 ms: 1.38x faster  |
+-------------------------+---------+-----------------------+
| telco                   | 7.69 ms | 6.60 ms: 1.16x faster |
+-------------------------+---------+-----------------------+
| tornado_http            | 233 ms  | 156 ms: 1.49x faster  |
+-------------------------+---------+-----------------------+
| unpack_sequence         | 64.5 ns | 42.8 ns: 1.51x faster |
+-------------------------+---------+-----------------------+
| unpickle                | 16.5 us | 14.2 us: 1.16x faster |
+-------------------------+---------+-----------------------+
| unpickle_list           | 5.83 us | 5.07 us: 1.15x faster |
+-------------------------+---------+-----------------------+
| unpickle_pure_python    | 388 us  | 236 us: 1.64x faster  |
+-------------------------+---------+-----------------------+
| xml_etree_parse         | 219 ms  | 164 ms: 1.33x faster  |
+-------------------------+---------+-----------------------+
| xml_etree_iterparse     | 152 ms  | 111 ms: 1.37x faster  |
+-------------------------+---------+-----------------------+
| xml_etree_generate      | 120 ms  | 85.1 ms: 1.41x faster |
+-------------------------+---------+-----------------------+
| xml_etree_process       | 95.7 ms | 59.3 ms: 1.61x faster |
+-------------------------+---------+-----------------------+
| Geometric mean          | (ref)   | 1.41x faster          |
+-------------------------+---------+-----------------------+

Impressive results.

 
Share this