Mailing List Archive

[issue24165] Free list for single-digits ints
Change by Inada Naoki <songofacandy@gmail.com>:


----------
pull_requests: +21823
pull_request: https://github.com/python/cpython/pull/22884

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue24165>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue24165] Free list for single-digits ints [ In reply to ]
Inada Naoki <songofacandy@gmail.com> added the comment:

I updated the patch.
I can not run pyperformance for now, because:

AssertionError: would build wheel with unsupported tag ('cp310', 'cp310', 'linux_x86_64'

I added this config, but it can not solve the problem:

```
$ cat ~/.config/pip/pip.conf
[global]
no-cache-dir = true
```

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue24165>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue24165] Free list for single-digits ints [ In reply to ]
Pablo Galindo Salgado <pablogsal@gmail.com> added the comment:

Inada-san, you can run pyperformance with this workaround:

python -m pip install pyperformance==1.0.0

We are fixing the error soon after https://discuss.python.org/t/pep-641-using-an-underscore-in-the-version-portion-of-python-3-10-compatibility-tags/5513 lands

----------
nosy: +pablogsal

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue24165>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue24165] Free list for single-digits ints [ In reply to ]
Inada Naoki <songofacandy@gmail.com> added the comment:

I heard pyperformance 1.0.0 works and here is the result of PR-22884.

$ ./python-master -m pyperf compare_to master.json patched.json -G --min-speed=1
Slower (8):
- pathlib: 26.3 ms +- 0.3 ms -> 26.8 ms +- 0.4 ms: 1.02x slower (+2%)
- chameleon: 12.8 ms +- 0.1 ms -> 13.0 ms +- 0.1 ms: 1.02x slower (+2%)
- genshi_text: 38.3 ms +- 0.7 ms -> 38.9 ms +- 0.6 ms: 1.02x slower (+2%)
- sqlalchemy_imperative: 40.4 ms +- 0.9 ms -> 41.0 ms +- 0.8 ms: 1.02x slower (+2%)
- sympy_str: 441 ms +- 4 ms -> 448 ms +- 4 ms: 1.01x slower (+1%)
- chaos: 146 ms +- 1 ms -> 148 ms +- 2 ms: 1.01x slower (+1%)
- unpickle: 18.7 us +- 0.1 us -> 18.9 us +- 0.2 us: 1.01x slower (+1%)
- xml_etree_parse: 177 ms +- 2 ms -> 179 ms +- 3 ms: 1.01x slower (+1%)

Faster (11):
- scimark_sparse_mat_mult: 6.74 ms +- 0.18 ms -> 6.26 ms +- 0.03 ms: 1.08x faster (-7%)
- scimark_fft: 511 ms +- 7 ms -> 496 ms +- 4 ms: 1.03x faster (-3%)
- spectral_norm: 181 ms +- 2 ms -> 176 ms +- 3 ms: 1.03x faster (-3%)
- pidigits: 225 ms +- 1 ms -> 219 ms +- 1 ms: 1.03x faster (-3%)
- pickle_dict: 35.5 us +- 1.3 us -> 34.8 us +- 0.3 us: 1.02x faster (-2%)
- pickle_list: 5.32 us +- 0.09 us -> 5.23 us +- 0.09 us: 1.02x faster (-2%)
- pyflate: 883 ms +- 7 ms -> 867 ms +- 6 ms: 1.02x faster (-2%)
- scimark_sor: 264 ms +- 2 ms -> 259 ms +- 2 ms: 1.02x faster (-2%)
- sqlite_synth: 4.04 us +- 0.10 us -> 3.98 us +- 0.09 us: 1.02x faster (-1%)
- regex_dna: 243 ms +- 3 ms -> 240 ms +- 1 ms: 1.01x faster (-1%)
- crypto_pyaes: 165 ms +- 3 ms -> 163 ms +- 1 ms: 1.01x faster (-1%)

Benchmark hidden because not significant (41)

----------
nosy: -pablogsal

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue24165>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue24165] Free list for single-digits ints [ In reply to ]
Change by Yury Selivanov <yselivanov@gmail.com>:


----------
nosy: +pablogsal

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue24165>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue24165] Free list for single-digits ints [ In reply to ]
Yury Selivanov <yselivanov@gmail.com> added the comment:

Inada-san, how do you interpret the results? Looks like it's performance-neutral.

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue24165>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue24165] Free list for single-digits ints [ In reply to ]
Inada Naoki <songofacandy@gmail.com> added the comment:

I had suspected that pypeformance just don't have enough workload for non-small int.

For example, spectral_norm is integer heavy + some float warkload. But bm_spectral_norm uses `DEFAULT_N = 130`. So most integers are fit into smallint cache.

On the othar hand, spectral_norm in the benchmarkgame uses N=5500.
https://benchmarksgame-team.pages.debian.net/benchmarksgame/program/spectralnorm-python3-8.html

So I ran the benchmark on my machine:

master:
real 1m24.647s
user 5m37.515s

patched:
real 1m19.033s
user 5m14.682s

master+increased small int from [-5, 256] to [-9, 1024]
real 1m23.742s
user 5m33.569s


314.682/337.515 = 0.9323496733478512. So ther is only 7% speedup even when N=5500.

After all, I think it is doubtful. Let's stop this idea until situation is changed.

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue24165>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue24165] Free list for single-digits ints [ In reply to ]
Inada Naoki <songofacandy@gmail.com> added the comment:

I close this issue for now. Please reopen or create a new issue if you came up with better idea.

----------
resolution: -> rejected
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10 -Python 3.7

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue24165>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue24165] Free list for single-digits ints [ In reply to ]
Serhiy Storchaka <storchaka+cpython@gmail.com> added the comment:

I agree that it is not worth to add this optimization.

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue24165>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue24165] Free list for single-digits ints [ In reply to ]
STINNER Victor <vstinner@python.org> added the comment:

> Inada-san, how do you interpret the results? Looks like it's performance-neutral.

You should give a try to the development branch of pyperf which computes the geometric mean of all results and says if it's faster or slower overall :-D
https://mail.python.org/archives/list/speed@python.org/thread/RANN6PQURUVPMNXS6GIOL42F2DIFV5LM/
(I'm still waiting for testers before releasing a new version including the new feature.)

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue24165>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com