hpyproject / hpy

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

Improve implementation of HPy_(Type | Is | GetItem_i) in CPython ABI mode. #471

Closed fangerer closed 5 months ago

fangerer commented 5 months ago

Some time ago, I've mentioned that the call overhead in the implementation of HPy_Type was crucial (in CPython ABI mode) for the NumPy/HPy demo. The same applies to HPy_Is. Therefore, I'm essentially inlining the implementation into the appropriate API functions. I also did a little improvement in HPy_GetItem_i to avoid unnecessary allocation of long objects.