Rune Hansén Steinnes
The comfy chair

The comfy chair

Python 3.11-b4

The need for speed.. Breaking news! Python 3.11-rc1 is out and it's even faster.

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

4 min read

+-------------------------+---------+-----------------------+
| Geometric mean          | (ref)   | 1.42x faster          |
+-------------------------+---------+-----------------------+
             .',;::::;,'.                roderik@genabackis 
         .';:cccccccccccc:;,.            ------------------ 
      .;cccccccccccccccccccccc;.         OS: Fedora Linux 36 (Workstation Edition) x86_64 
    .:cccccccccccccccccccccccccc:.       Host: XPS 15 9560 
  .;ccccccccccccc;.:dddl:.;ccccccc;.     Kernel: 5.18.10-200.fc36.x86_64 
 .:ccccccccccccc;OWMKOOXMWd;ccccccc:.    Uptime: 21 hours, 19 mins 
.:ccccccccccccc;KMMc;cc;xMMc:ccccccc:.   Packages: 2218 (rpm), 17 (flatpak) 
,cccccccccccccc;MMM.;cc;;WW::cccccccc,   Shell: zsh 5.8.1 
:cccccccccccccc;MMM.;cccccccccccccccc:   Resolution: 1920x1080 
:ccccccc;oxOOOo;MMM0OOk.;cccccccccccc:   DE: GNOME 42.3.1 
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: 10099MiB / 15737MiB

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

$ podman run -t -d python:3.11-rc
$ 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                 |
+=========================+=========+=======================+
| 2to3                    | 365 ms  | 304 ms: 1.20x faster  |
+-------------------------+---------+-----------------------+
| chameleon               | 9.92 ms | 7.40 ms: 1.34x faster |
+-------------------------+---------+-----------------------+
| chaos                   | 119 ms  | 76.5 ms: 1.55x faster |
+-------------------------+---------+-----------------------+
| crypto_pyaes            | 137 ms  | 88.0 ms: 1.56x faster |
+-------------------------+---------+-----------------------+
| deltablue               | 8.79 ms | 4.32 ms: 2.04x faster |
+-------------------------+---------+-----------------------+
| django_template         | 56.2 ms | 38.8 ms: 1.45x faster |
+-------------------------+---------+-----------------------+
| dulwich_log             | 110 ms  | 90.9 ms: 1.21x faster |
+-------------------------+---------+-----------------------+
| fannkuch                | 539 ms  | 422 ms: 1.28x faster  |
+-------------------------+---------+-----------------------+
| float                   | 121 ms  | 83.8 ms: 1.44x faster |
+-------------------------+---------+-----------------------+
| genshi_text             | 31.4 ms | 23.5 ms: 1.33x faster |
+-------------------------+---------+-----------------------+
| genshi_xml              | 71.3 ms | 59.0 ms: 1.21x faster |
+-------------------------+---------+-----------------------+
| go                      | 246 ms  | 154 ms: 1.59x faster  |
+-------------------------+---------+-----------------------+
| hexiom                  | 9.72 ms | 7.09 ms: 1.37x faster |
+-------------------------+---------+-----------------------+
| html5lib                | 96.9 ms | 70.8 ms: 1.37x faster |
+-------------------------+---------+-----------------------+
| json_dumps              | 16.1 ms | 14.5 ms: 1.11x faster |
+-------------------------+---------+-----------------------+
| json_loads              | 29.8 us | 28.6 us: 1.04x faster |
+-------------------------+---------+-----------------------+
| logging_format          | 10.6 us | 7.98 us: 1.33x faster |
+-------------------------+---------+-----------------------+
| logging_silent          | 177 ns  | 109 ns: 1.63x faster  |
+-------------------------+---------+-----------------------+
| logging_simple          | 9.58 us | 7.27 us: 1.32x faster |
+-------------------------+---------+-----------------------+
| mako                    | 17.2 ms | 12.6 ms: 1.37x faster |
+-------------------------+---------+-----------------------+
| meteor_contest          | 120 ms  | 115 ms: 1.05x faster  |
+-------------------------+---------+-----------------------+
| nbody                   | 139 ms  | 103 ms: 1.35x faster  |
+-------------------------+---------+-----------------------+
| nqueens                 | 110 ms  | 95.1 ms: 1.16x faster |
+-------------------------+---------+-----------------------+
| pathlib                 | 27.6 ms | 25.8 ms: 1.07x faster |
+-------------------------+---------+-----------------------+
| pickle_list             | 4.77 us | 4.42 us: 1.08x faster |
+-------------------------+---------+-----------------------+
| pickle_pure_python      | 474 us  | 346 us: 1.37x faster  |
+-------------------------+---------+-----------------------+
| pidigits                | 202 ms  | 211 ms: 1.04x slower  |
+-------------------------+---------+-----------------------+
| pyflate                 | 703 ms  | 471 ms: 1.49x faster  |
+-------------------------+---------+-----------------------+
| python_startup          | 12.5 ms | 11.3 ms: 1.11x faster |
+-------------------------+---------+-----------------------+
| raytrace                | 607 ms  | 333 ms: 1.82x faster  |
+-------------------------+---------+-----------------------+
| regex_compile           | 229 ms  | 152 ms: 1.51x faster  |
+-------------------------+---------+-----------------------+
| regex_dna               | 262 ms  | 226 ms: 1.16x faster  |
+-------------------------+---------+-----------------------+
| regex_effbot            | 3.89 ms | 3.36 ms: 1.16x faster |
+-------------------------+---------+-----------------------+
| regex_v8                | 29.9 ms | 25.4 ms: 1.18x faster |
+-------------------------+---------+-----------------------+
| richards                | 89.8 ms | 50.4 ms: 1.78x faster |
+-------------------------+---------+-----------------------+
| scimark_fft             | 483 ms  | 349 ms: 1.38x faster  |
+-------------------------+---------+-----------------------+
| scimark_lu              | 195 ms  | 114 ms: 1.71x faster  |
+-------------------------+---------+-----------------------+
| scimark_monte_carlo     | 124 ms  | 72.0 ms: 1.73x faster |
+-------------------------+---------+-----------------------+
| scimark_sor             | 238 ms  | 125 ms: 1.89x faster  |
+-------------------------+---------+-----------------------+
| scimark_sparse_mat_mult | 6.27 ms | 4.91 ms: 1.28x faster |
+-------------------------+---------+-----------------------+
| spectral_norm           | 177 ms  | 115 ms: 1.53x faster  |
+-------------------------+---------+-----------------------+
| sqlalchemy_declarative  | 229 ms  | 153 ms: 1.50x faster  |
+-------------------------+---------+-----------------------+
| sqlalchemy_imperative   | 34.1 ms | 23.0 ms: 1.48x faster |
+-------------------------+---------+-----------------------+
| sqlite_synth            | 3.80 us | 2.68 us: 1.42x faster |
+-------------------------+---------+-----------------------+
| sympy_expand            | 721 ms  | 518 ms: 1.39x faster  |
+-------------------------+---------+-----------------------+
| sympy_integrate         | 32.0 ms | 23.8 ms: 1.35x faster |
+-------------------------+---------+-----------------------+
| sympy_sum               | 256 ms  | 191 ms: 1.34x faster  |
+-------------------------+---------+-----------------------+
| sympy_str               | 429 ms  | 339 ms: 1.27x faster  |
+-------------------------+---------+-----------------------+
| telco                   | 7.69 ms | 7.12 ms: 1.08x faster |
+-------------------------+---------+-----------------------+
| tornado_http            | 233 ms  | 156 ms: 1.49x faster  |
+-------------------------+---------+-----------------------+
| unpack_sequence         | 64.5 ns | 50.8 ns: 1.27x faster |
+-------------------------+---------+-----------------------+
| unpickle                | 16.5 us | 14.4 us: 1.15x faster |
+-------------------------+---------+-----------------------+
| unpickle_list           | 5.83 us | 5.42 us: 1.07x faster |
+-------------------------+---------+-----------------------+
| unpickle_pure_python    | 388 us  | 262 us: 1.48x faster  |
+-------------------------+---------+-----------------------+
| xml_etree_parse         | 219 ms  | 173 ms: 1.27x faster  |
+-------------------------+---------+-----------------------+
| xml_etree_iterparse     | 152 ms  | 117 ms: 1.30x faster  |
+-------------------------+---------+-----------------------+
| xml_etree_generate      | 120 ms  | 87.1 ms: 1.37x faster |
+-------------------------+---------+-----------------------+
| xml_etree_process       | 95.7 ms | 60.4 ms: 1.59x faster |
+-------------------------+---------+-----------------------+
| Geometric mean          | (ref)   | 1.33x faster          |
+-------------------------+---------+-----------------------+

Impressive results.

 
Share this