[issue31543] Optimize wrapper descriptors using FASTCALL

2017-11-23 Thread STINNER Victor
STINNER Victor added the comment: It seems like these specific descriptors are rare, so the added complexity is not worth it. I close my issue as rejected. -- resolution: -> rejected stage: patch review -> resolved status: open -> closed ___ Python

[issue31543] Optimize wrapper descriptors using FASTCALL

2017-09-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: These slots are the only slots that accept keyword arguments and arbitrary number of positional parameters. Other slots can use fast calls. -- ___ Python tracker __

[issue31543] Optimize wrapper descriptors using FASTCALL

2017-09-21 Thread STINNER Victor
STINNER Victor added the comment: The most complex slots are __new__, __init__ and __call__ because they accept keywords. It's hard to design a calling convention which optimize all cases because of the backward compatibility. The risk is to convert a dict to args + kwnames (tuple) and then back

[issue31543] Optimize wrapper descriptors using FASTCALL

2017-09-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: This seems like a straight-forward win. I don't think we really need to see microbenchmarks before going forward with this one. -- nosy: +rhettinger ___ Python tracker __

[issue31543] Optimize wrapper descriptors using FASTCALL

2017-09-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It optimizes the same cases as bpo-31410. bpo-31410 removed a half of the overhead for wrapper descriptors, Victor's patch removes the remaining half. Actually it makes calling the descriptor faster than calling the corresponding builtin! But bpo-31410 chang

[issue31543] Optimize wrapper descriptors using FASTCALL

2017-09-21 Thread STINNER Victor
STINNER Victor added the comment: > I don't know. What's the point of optimizing `array.array.__len__(obj)`? > People usually call `len(obj)` for that... Right, type.method(self) is less than common than self.method(). I looked at the stdlib. I found that the following method are called using

[issue31543] Optimize wrapper descriptors using FASTCALL

2017-09-21 Thread Antoine Pitrou
Antoine Pitrou added the comment: > First I would like to know if it's worth it I don't know. What's the point of optimizing `array.array.__len__(obj)`? People usually call `len(obj)` for that... -- nosy: +pitrou ___ Python tracker

[issue31543] Optimize wrapper descriptors using FASTCALL

2017-09-21 Thread STINNER Victor
Changes by STINNER Victor : -- keywords: +patch pull_requests: +3674 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-l

[issue31543] Optimize wrapper descriptors using FASTCALL

2017-09-21 Thread STINNER Victor
New submission from STINNER Victor: Attached pull request adds a fastpath for wrapper descriptors to use the FASTCALL calling convention. It's a follow up of bpo-31410 and all my work on FASTCALL during Python 3.6 and 3.7 development cycles. Microbenchmark: ./python -m perf timeit -s 'import