[issue24165] Free list for single-digits ints

2021-09-18 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: +gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue24165] Free list for single-digits ints

2020-11-01 Thread STINNER Victor
STINNER Victor 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

[issue24165] Free list for single-digits ints

2020-10-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I agree that it is not worth to add this optimization. -- ___ Python tracker ___ ___

[issue24165] Free list for single-digits ints

2020-10-24 Thread Inada Naoki
Inada Naoki 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

[issue24165] Free list for single-digits ints

2020-10-22 Thread Inada Naoki
Inada Naoki 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

[issue24165] Free list for single-digits ints

2020-10-22 Thread Yury Selivanov
Yury Selivanov added the comment: Inada-san, how do you interpret the results? Looks like it's performance-neutral. -- ___ Python tracker ___

[issue24165] Free list for single-digits ints

2020-10-22 Thread Yury Selivanov
Change by Yury Selivanov : -- nosy: +pablogsal ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue24165] Free list for single-digits ints

2020-10-22 Thread Inada Naoki
Inada Naoki 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

[issue24165] Free list for single-digits ints

2020-10-22 Thread Pablo Galindo Salgado
Pablo Galindo Salgado 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

[issue24165] Free list for single-digits ints

2020-10-22 Thread Inada Naoki
Inada Naoki 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]

[issue24165] Free list for single-digits ints

2020-10-22 Thread Inada Naoki
Change by Inada Naoki : -- pull_requests: +21823 pull_request: https://github.com/python/cpython/pull/22884 ___ Python tracker ___

[issue24165] Free list for single-digits ints

2020-05-29 Thread Brett Cannon
Change by Brett Cannon : -- nosy: -brett.cannon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue24165] Free list for single-digits ints

2016-12-20 Thread INADA Naoki
INADA Naoki added the comment: Performance version: 0.5.0 Python version: 3.7.0a0 (64-bit) revision 31df7d9863f3+ Report on Linux-4.8.0-30-generic-x86_64-with-debian-stretch-sid Slower (13): - nbody: 232 ms +- 3 ms -> 241 ms +- 6 ms: 1.04x slower - unpack_sequence: 118 ns +- 3 ns -> 121 ns +- 0

[issue24165] Free list for single-digits ints

2016-12-19 Thread INADA Naoki
Changes by INADA Naoki : -- nosy: +inada.naoki versions: +Python 3.7 -Python 3.6 ___ Python tracker ___

[issue24165] Free list for single-digits ints

2016-04-14 Thread Larry Hastings
Larry Hastings added the comment: FWIW, the patch still cleanly applies, but now a couple tests in posix fail because the assertion text has changed. -- ___ Python tracker

[issue24165] Free list for single-digits ints

2016-02-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > 99% of all long allocations are coming from freelist when it's there. Detailed statistics from a test suite run see in msg242886. Only a half of ints are single-digit with 15-bit digits, and 3/4 with 30-bit digits. 86% of ints are 32-bit. The majority of

[issue24165] Free list for single-digits ints

2016-02-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: The test suite can't really be representative of common workloads and it isn't meant to be. The real question is not so much if the freelist helps reduce the number of integer allocations (it's obvious it will), it's whether doing so actually speeds up

[issue24165] Free list for single-digits ints

2016-02-12 Thread STINNER Victor
STINNER Victor added the comment: I ran again the benchmark on long_fl.patch of issue #26341 with -b all. The problem is that I don't know what to think about the benchmark, to me all these number only look like noise :-/ If we ignore changes smaller than 1.05 (positive or negative), the

[issue24165] Free list for single-digits ints

2016-02-12 Thread Stefan Behnel
Stefan Behnel added the comment: I like Serhiy's patch, too, but it feels like the single-digit case should be enough. I found this comment by Yury a good argument: """ I can see improvements in micro benchmarks, but even more importantly, Serhiy's patch reduces memory fragmentations. 99% of

[issue24165] Free list for single-digits ints

2016-02-11 Thread Yury Selivanov
Yury Selivanov added the comment: I think that we only need to add free-list for 1-digit longs. Please see my patch & explanation in issue #26341. -- nosy: +yselivanov ___ Python tracker

[issue24165] Free list for single-digits ints

2016-02-11 Thread Mark Lawrence
Changes by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___

[issue24165] Free list for single-digits ints

2016-02-11 Thread Yury Selivanov
Yury Selivanov added the comment: > Did you test on platform with 30-bit digits? Yes. > Could you repeat my microbenchmarks from msg242919? Sure. With your patches or with mine from issue #26341? -- ___ Python tracker

[issue24165] Free list for single-digits ints

2016-02-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Did you test on platform with 30-bit digits? I tested with 15-bit digits. Could you repeat my microbenchmarks from msg242919? -- ___ Python tracker

[issue24165] Free list for single-digits ints

2016-02-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: With all three patches if you want (I don't expect a difference between your patch and my single-digit patch). -- ___ Python tracker

[issue24165] Free list for single-digits ints

2016-02-11 Thread Yury Selivanov
Yury Selivanov added the comment: I also ran benchmarks. For me, django was 1% faster, telco 5% slower, and the rest were the same. telco is a decimal benchmarks (ints aren't used there), and django/chameleon are unicode concatenation benchmarks. I can see improvements in micro benchmarks,

[issue24165] Free list for single-digits ints

2016-02-11 Thread Yury Selivanov
Yury Selivanov added the comment: Best of 5s: -m timeit -s "r = range(10**4)" -- "for i in r: pass" orig: 239 usec my patch: 148 int_free_list_2: 151 int_free_list_multi: 156 -m timeit -s "r = range(10**5)" -- "for i in r: pass" orig: 2.4 msec my patch: 1.47 int_free_list_2: 1.53

[issue24165] Free list for single-digits ints

2016-02-11 Thread STINNER Victor
STINNER Victor added the comment: I ran perf.py on long_fl.patch of issue #26341. It looks slower and has no impact on such macro benchmark. ~/bin/taskset_isolated.py time python3 -u perf.py --rigorous ../default/python.orig ../default/python_long_fl # python rev 37bacf3fa1f5 Report on

[issue24165] Free list for single-digits ints

2015-07-21 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- nosy: -ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24165 ___ ___ Python-bugs-list

[issue24165] Free list for single-digits ints

2015-05-11 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Proposed patch adds free list for single-digit PyLong objects. In Python tests 7% of created objects are ints. 50% of them are 15-bit (single-digit on 32-bit build), 75% of them are 30-bit (single-digit on 64-bit build). See the start of the discussion in

[issue24165] Free list for single-digits ints

2015-05-11 Thread Brett Cannon
Brett Cannon added the comment: Any chance of running hg.python.org/benchmarks to see what kind of performance this would get us? -- nosy: +brett.cannon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24165

[issue24165] Free list for single-digits ints

2015-05-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Report on Linux xarax 3.13.0-52-generic #86-Ubuntu SMP Mon May 4 04:32:15 UTC 2015 i686 athlon Total CPU cores: 2 ### 2to3 ### 15.796000 - 15.652000: 1.01x faster ### etree_generate ### Min: 0.687270 - 0.715218: 1.04x slower Avg: 0.698458 - 0.722657: 1.03x

[issue24165] Free list for single-digits ints

2015-05-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: You probably need a workload that uses integers quite heavily to see a difference. And even then, it would also depend on the allocation pattern. -- ___ Python tracker rep...@bugs.python.org

[issue24165] Free list for single-digits ints

2015-05-11 Thread Stefan Behnel
Stefan Behnel added the comment: Well, as I've shown in issue 24076 (I'm copying the numbers here), even simple arithmetic expressions can benefit from a free-list. Basically anything that uses temporary integer results. Original: $ ./python -m timeit 'sum(range(1, 10))' 1000 loops, best

[issue24165] Free list for single-digits ints

2015-05-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: Yes, but I meant a realistic workload, not a micro-benchmark. There are tons of ways to make Python look faster on micro-benchmarks but that have no relevant impact on actual applications. (note that I'm still sympathetic to the freelist approach) --

[issue24165] Free list for single-digits ints

2015-05-11 Thread Stefan Behnel
Stefan Behnel added the comment: I got similar results on 64bits for my original patch (very similar to what Serhiy used now). The numbers are not really conclusive. Report on Linux leppy 3.13.0-46-generic #77-Ubuntu SMP Mon Mar 2 18:23:39 UTC 2015 x86_64 x86_64 Total CPU cores: 4 ### 2to3

[issue24165] Free list for single-digits ints

2015-05-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Oh, sorry, Stefan, I didn't noticed your patch. I wouldn't write my patch if noticed your patch. int_free_list_2.patch adds free list only for single-digits ints. Following patch adds free list for multi-digit ints (3 on 32-bit build, 2 on 64-bit build)