Have you some experience / link about difference between Python builded with gcc and clang?
Marco Sulla
mail.python.org at marco.sulla.e4ward.com
Sun Mar 1 18:23:09 EST 2020
Good! Have you compiled it optimized (--enable-optimizations --with-lto)?
On Sun, 1 Mar 2020 at 23:48, Skip Montanaro <skip.montanaro at gmail.com> wrote:
>
> > As title. Currently I'm using gcc 9.2.0 and its compilation seems to
> > work well and fast. But I would know by your experience if clang can
> > produce, on a *nix system, a "faster Python".
>
> I took a quick run at this as I was wanting to give pyperformance a try. Comparing GCC 9 with CLANG 8 on my Ubuntu laptop here's what I got. It seems that GCC was a bit faster than CLANG pretty much across the board.
>
> +-------------------------+---------+-------------------------------+
> | Benchmark | gcc | clang |
> +=========================+=========+===============================+
> | 2to3 | 403 ms | 440 ms: 1.09x slower (+9%) |
> +-------------------------+---------+-------------------------------+
> | chameleon | 12.6 ms | 13.5 ms: 1.07x slower (+7%) |
> +-------------------------+---------+-------------------------------+
> | chaos | 148 ms | 169 ms: 1.14x slower (+14%) |
> +-------------------------+---------+-------------------------------+
> | crypto_pyaes | 145 ms | 157 ms: 1.08x slower (+8%) |
> +-------------------------+---------+-------------------------------+
> | deltablue | 9.79 ms | 11.4 ms: 1.17x slower (+17%) |
> +-------------------------+---------+-------------------------------+
> | django_template | 69.9 ms | 77.6 ms: 1.11x slower (+11%) |
> +-------------------------+---------+-------------------------------+
> | dulwich_log | 89.3 ms | 92.6 ms: 1.04x slower (+4%) |
> +-------------------------+---------+-------------------------------+
> | fannkuch | 590 ms | 602 ms: 1.02x slower (+2%) |
> +-------------------------+---------+-------------------------------+
> | float | 150 ms | 160 ms: 1.07x slower (+7%) |
> +-------------------------+---------+-------------------------------+
> | genshi_text | 35.9 ms | 39.4 ms: 1.10x slower (+10%) |
> +-------------------------+---------+-------------------------------+
> | genshi_xml | 74.8 ms | 81.8 ms: 1.09x slower (+9%) |
> +-------------------------+---------+-------------------------------+
> | go | 339 ms | 390 ms: 1.15x slower (+15%) |
> +-------------------------+---------+-------------------------------+
> | hexiom | 12.9 ms | 14.3 ms: 1.11x slower (+11%) |
> +-------------------------+---------+-------------------------------+
> | json_dumps | 16.4 ms | 17.6 ms: 1.07x slower (+7%) |
> +-------------------------+---------+-------------------------------+
> | json_loads | 32.9 us | 34.6 us: 1.05x slower (+5%) |
> +-------------------------+---------+-------------------------------+
> | logging_format | 13.9 us | 15.2 us: 1.09x slower (+9%) |
> +-------------------------+---------+-------------------------------+
> | logging_silent | 253 ns | 298 ns: 1.18x slower (+18%) |
> +-------------------------+---------+-------------------------------+
> | logging_simple | 12.6 us | 14.1 us: 1.12x slower (+12%) |
> +-------------------------+---------+-------------------------------+
> | mako | 21.8 ms | 24.2 ms: 1.11x slower (+11%) |
> +-------------------------+---------+-------------------------------+
> | meteor_contest | 128 ms | 133 ms: 1.04x slower (+4%) |
> +-------------------------+---------+-------------------------------+
> | nbody | 181 ms | 190 ms: 1.05x slower (+5%) |
> +-------------------------+---------+-------------------------------+
> | nqueens | 128 ms | 135 ms: 1.05x slower (+5%) |
> +-------------------------+---------+-------------------------------+
> | pathlib | 26.3 ms | 27.1 ms: 1.03x slower (+3%) |
> +-------------------------+---------+-------------------------------+
> | pickle | 13.3 us | 13.5 us: 1.01x slower (+1%) |
> +-------------------------+---------+-------------------------------+
> | pickle_dict | 33.8 us | 33.6 us: 1.01x faster (-1%) |
> +-------------------------+---------+-------------------------------+
> | pickle_list | 4.82 us | 5.18 us: 1.07x slower (+7%) |
> +-------------------------+---------+-------------------------------+
> | pickle_pure_python | 613 us | 725 us: 1.18x slower (+18%) |
> +-------------------------+---------+-------------------------------+
> | pidigits | 210 ms | 218 ms: 1.04x slower (+4%) |
> +-------------------------+---------+-------------------------------+
> | pyflate | 871 ms | 1.00 sec: 1.15x slower (+15%) |
> +-------------------------+---------+-------------------------------+
> | python_startup | 10.3 ms | 10.4 ms: 1.01x slower (+1%) |
> +-------------------------+---------+-------------------------------+
> | python_startup_no_site | 7.16 ms | 7.39 ms: 1.03x slower (+3%) |
> +-------------------------+---------+-------------------------------+
> | raytrace | 686 ms | 800 ms: 1.17x slower (+17%) |
> +-------------------------+---------+-------------------------------+
> | regex_compile | 223 ms | 240 ms: 1.07x slower (+7%) |
> +-------------------------+---------+-------------------------------+
> | regex_effbot | 3.70 ms | 3.85 ms: 1.04x slower (+4%) |
> +-------------------------+---------+-------------------------------+
> | regex_v8 | 27.9 ms | 28.7 ms: 1.03x slower (+3%) |
> +-------------------------+---------+-------------------------------+
> | richards | 95.4 ms | 114 ms: 1.19x slower (+19%) |
> +-------------------------+---------+-------------------------------+
> | scimark_fft | 470 ms | 538 ms: 1.14x slower (+14%) |
> +-------------------------+---------+-------------------------------+
> | scimark_lu | 205 ms | 210 ms: 1.03x slower (+3%) |
> +-------------------------+---------+-------------------------------+
> | scimark_monte_carlo | 138 ms | 151 ms: 1.09x slower (+9%) |
> +-------------------------+---------+-------------------------------+
> | scimark_sor | 257 ms | 297 ms: 1.15x slower (+15%) |
> +-------------------------+---------+-------------------------------+
> | scimark_sparse_mat_mult | 6.19 ms | 6.24 ms: 1.01x slower (+1%) |
> +-------------------------+---------+-------------------------------+
> | spectral_norm | 177 ms | 216 ms: 1.22x slower (+22%) |
> +-------------------------+---------+-------------------------------+
> | sqlalchemy_declarative | 199 ms | 205 ms: 1.03x slower (+3%) |
> +-------------------------+---------+-------------------------------+
> | sqlalchemy_imperative | 39.7 ms | 40.2 ms: 1.01x slower (+1%) |
> +-------------------------+---------+-------------------------------+
> | sqlite_synth | 3.74 us | 3.86 us: 1.03x slower (+3%) |
> +-------------------------+---------+-------------------------------+
> | sympy_expand | 638 ms | 671 ms: 1.05x slower (+5%) |
> +-------------------------+---------+-------------------------------+
> | sympy_integrate | 30.3 ms | 31.7 ms: 1.05x slower (+5%) |
> +-------------------------+---------+-------------------------------+
> | sympy_sum | 270 ms | 282 ms: 1.04x slower (+4%) |
> +-------------------------+---------+-------------------------------+
> | sympy_str | 423 ms | 440 ms: 1.04x slower (+4%) |
> +-------------------------+---------+-------------------------------+
> | telco | 8.44 ms | 8.35 ms: 1.01x faster (-1%) |
> +-------------------------+---------+-------------------------------+
> | tornado_http | 210 ms | 221 ms: 1.05x slower (+5%) |
> +-------------------------+---------+-------------------------------+
> | unpack_sequence | 65.1 ns | 60.8 ns: 1.07x faster (-7%) |
> +-------------------------+---------+-------------------------------+
> | unpickle | 17.6 us | 19.0 us: 1.08x slower (+8%) |
> +-------------------------+---------+-------------------------------+
> | unpickle_list | 5.46 us | 5.32 us: 1.03x faster (-3%) |
> +-------------------------+---------+-------------------------------+
> | unpickle_pure_python | 423 us | 478 us: 1.13x slower (+13%) |
> +-------------------------+---------+-------------------------------+
> | xml_etree_parse | 176 ms | 191 ms: 1.09x slower (+9%) |
> +-------------------------+---------+-------------------------------+
> | xml_etree_iterparse | 123 ms | 133 ms: 1.08x slower (+8%) |
> +-------------------------+---------+-------------------------------+
> | xml_etree_generate | 118 ms | 125 ms: 1.06x slower (+6%) |
> +-------------------------+---------+-------------------------------+
> | xml_etree_process | 95.5 ms | 100 ms: 1.05x slower (+5%) |
> +-------------------------+---------+-------------------------------+
>
> Skip
>
More information about the Python-list
mailing list