[pythran] Re: PEP 576 and PEP 580
- From: Serge Guelton <serge.guelton@xxxxxxxxxxxxxxxxxxx>
- To: pythran@xxxxxxxxxxxxx
- Date: Tue, 10 Jul 2018 18:03:03 +0200
On Tue, Jul 10, 2018 at 03:22:49PM +0200, Jeroen Demeyer wrote:
Dear Pythran developers,
I want to draw your attention to PEP 576  and 580 . I'm the author of
PEP 580. The basic problem that these try to solve is that CPython has
various optimizations for calling built-in functions/methods but that
user-defined classes cannot benefit from these. Those PEPs define a protocol
which every class can use. Since Pythran is all about creating fast
functions, I think that it could benefit from a faster calling protocol. The
two PEPs in question are two different solutions to this problem. I wrote a
comparison in  between the two.
So my question to you is: does this look useful for Pythran? If so, do you
prefer PEP 576 or PEP 580?
Hi Jeroen and thanks for the pointers!
PEP 576 is easier to understand in terms of implementation and
implication and I can see a clear benefit from the __signature__
attribute. Porting Pythran to use that PEP looks relatively easy.
PEP 580 looks more complex, but more generic too, which seems good, but
I failed to understand the details at first read :-)
Fortunately, you provided a third link I missed after first read :-) I
agree on your « better abstraction is better » argument!
Function call overhead is scarcely an issue for pythran kernel that tend
to be quite computation intensive, but I can imagine situation
(callbacks ? lowlevelcallable) where this would matter.
Other related posts: