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 malin
Recipients Greg Price, aeros, malin, mark.dickinson, rhettinger, sir-sigurd
Date 2019-09-08.05:53:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1567921997.4.0.851324833966.issue38015@roundup.psfhosted.org>
In-reply-to
Content
> This change produces tiny, but measurable speed-up for handling small ints

I didn't get measurable change, I run this command a dozen times and take the best result:

D:\dev\cpython\PCbuild\amd64\python.exe -m pyperf timeit -s "from collections import deque; consume = deque(maxlen=0).extend; r = range(256)" "consume(r)"  --duplicate=1000

before: Mean +- std dev: 771 ns +- 16 ns
after:  Mean +- std dev: 770 ns +- 10 ns

Environment:
    64-bit release build by MSVC 2017
    CPU: i3 4160, System: latest Windows 10 64-bit

Check the machine code from godbolt.org, x64 MSVC v19.14 only saves one instruction:
    movsxd  rax, ecx

x86-64 GCC 9.2 saves two instructions:
    lea     eax, [rdi+5]
    cdqe
History
Date User Action Args
2019-09-08 05:53:17malinsetrecipients: + malin, rhettinger, mark.dickinson, Greg Price, sir-sigurd, aeros
2019-09-08 05:53:17malinsetmessageid: <1567921997.4.0.851324833966.issue38015@roundup.psfhosted.org>
2019-09-08 05:53:17malinlinkissue38015 messages
2019-09-08 05:53:17malincreate