This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients Dennis Sweeney, lukasz.langa, rhettinger, serhiy.storchaka
Date 2021-09-18.21:32:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1632000728.24.0.264440410409.issue45026@roundup.psfhosted.org>
In-reply-to
Content
Iterating large integers:

$ ./python -m pyperf timeit -s 'r = range(0, 10**20, 3**35)' 'for i in r: pass'

baseline: Mean +- std dev: 223 us +- 10 us
PR 27986: Mean +- std dev: 128 us +- 4 us
PR 28176: Mean +- std dev: 99.0 us +- 3.7 us

$ ./python -m pyperf timeit -s 'r = range(0, 10**20, 3**35)' 'list(r)'
baseline: Mean +- std dev: 191 us +- 13 us
PR 27986: Mean +- std dev: 107 us +- 7 us
PR 28176: Mean +- std dev: 91.3 us +- 2.4 us

Unpickling:

$ ./python -m pyperf timeit -s 'from pickle import dumps, loads; p = dumps([iter(range(i)) for i in range(1000)])' 'loads(p)'
baseline: Mean +- std dev: 535 us +- 29 us
PR 27986: Mean +- std dev: 420 us +- 15 us
PR 28176: Mean +- std dev: 418 us +- 17 us

$ ./python -m pyperf timeit -s 'from pickle import dumps, loads; p = dumps([iter(range(i*10**10)) for i in range(1000)])' 'loads(p)'
baseline: Mean +- std dev: 652 us +- 37 us
PR 27986: Mean +- std dev: 530 us +- 43 us
PR 28176: Mean +- std dev: 523 us +- 17 us

Seems PR 28176 is slightly faster than PR 27986 in iterating long integers.
History
Date User Action Args
2021-09-18 21:32:08serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, lukasz.langa, Dennis Sweeney
2021-09-18 21:32:08serhiy.storchakasetmessageid: <1632000728.24.0.264440410409.issue45026@roundup.psfhosted.org>
2021-09-18 21:32:08serhiy.storchakalinkissue45026 messages
2021-09-18 21:32:08serhiy.storchakacreate