hpyproject / hpy

HPy: a better API for Python
https://hpyproject.org
MIT License
1.02k stars 52 forks source link

Add support for vectorcall protocol. #389

Closed fangerer closed 1 year ago

fangerer commented 1 year ago

In our Numpy/HPy port we've seen that calling ufunc objects is significantly slower because we don't support the vectorcall protocol. Although HPy's VARARGS calling convention is very similar to the vectorcall calling convention on the receiver side, there is still a big difference on the caller side. In particular, CPython will internally still allocate tuples for arguments and dicts for keyword arguments etc.

Besides that, PEP 590 describes some more shortcomings of the tp_call calling convention.