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 larry, scoder, serhiy.storchaka, vstinner, xtreak
Date 2019-01-11.17:09:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1547226579.06.0.836314325498.issue35582@roundup.psfhosted.org>
In-reply-to
Content
PR 11524 performs the same kind of changes as PR 11520, but for handwritten code (only if this causes noticeable speed up). Also iter() is now use the fast call convention.

$ ./python -m timeit "iter(())"
Unpatched:  5000000 loops, best of 5: 82.8 nsec per loop
Patched:    5000000 loops, best of 5: 56.3 nsec per loop

$ ./python -m timeit -s "it = iter([])" "next(it, None)"
Unpatched:  5000000 loops, best of 5: 54.1 nsec per loop
Patched:    5000000 loops, best of 5: 44.9 nsec per loop

$ ./python -m timeit "getattr(1, 'numerator')"
Unpatched:  5000000 loops, best of 5: 63.6 nsec per loop
Patched:    5000000 loops, best of 5: 57.5 nsec per loop

$ ./python -m timeit -s "from operator import attrgetter; f = attrgetter('numerator')" "f(1)"
Unpatched:  5000000 loops, best of 5: 64.1 nsec per loop
Patched:    5000000 loops, best of 5: 56.8 nsec per loop

$ ./python -m timeit -s "from operator import methodcaller; f = methodcaller('conjugate')" "f(1)"
Unpatched:  5000000 loops, best of 5: 79.5 nsec per loop
Patched:    5000000 loops, best of 5: 74.1 nsec per loop

It is possible to speed up also many math methods and maybe some contextvar and hamt methods, but this is for other issues.
History
Date User Action Args
2019-01-11 17:09:40serhiy.storchakasetrecipients: + serhiy.storchaka, scoder, vstinner, larry, xtreak
2019-01-11 17:09:39serhiy.storchakasetmessageid: <1547226579.06.0.836314325498.issue35582@roundup.psfhosted.org>
2019-01-11 17:09:39serhiy.storchakalinkissue35582 messages
2019-01-11 17:09:39serhiy.storchakacreate