[issue31410] int.__repr__() is slower than repr()

2017-09-21 Thread STINNER Victor
STINNER Victor added the comment: Oh, nice optimization! I see that you reused the _PyMethodDef_RawFastCallDict() function that I added exactly for the same reason: prevent the creation of a temporary C function only created for a single call and then destroyed. -- nosy: +inada.naoki

[issue31410] int.__repr__() is slower than repr()

2017-09-21 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue31410] int.__repr__() is slower than repr()

2017-09-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 5e02c7826f9797fb3add79b608ef51f7a62b3e5a by Serhiy Storchaka in branch 'master': bpo-31410: Optimized calling wrapper and classmethod descriptors. (#3481) https://github.com/python/cpython/commit/5e02c7826f9797fb3add79b608ef51f7a62b3e5a --

[issue31410] int.__repr__() is slower than repr()

2017-09-10 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- keywords: +patch pull_requests: +3471 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue31410] int.__repr__() is slower than repr()

2017-09-10 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Following the StackOverflow question [1]. Calling repr() is faster than calling unbound method __repr__(). This looks strange at first glance because it is *obvious* that repr() is implemented via calling __repr__(). $ ./python -m timeit "''.join(map(repr