@hansgeunsmeyer
Thanks for the reply. Well, I spent a lot of time to benchmark pure cpython, cython, pybind11 and cffi. Among them the winner is pure cpython with ctypes. I think, converting python objects to and from foreign language is the cause of the delay. In my tests, ctypes has 2x speed than cython. It’s good to know about the backgrounds of my project. I am doing a gui library project with windows api functions. So most of the time, execution is happening over c functions. And there are plenty of times python needs to call these functions. So the parameter conversion is taking the toll. A simple window with two buttons in pybind took 75-100 ms. The same in cython took 55-70 ms. In ctypes with pure python, it is almost same of cython. But if I use Odin for all the heavy lifting, I can reduce the speed to almost 10-12 ms. Then I tested the same odin dll with cython. The speed went to 20-25 ms.
EDIT : I forgot to mention the speed of CFFI. It is performing very well but in “API-out of line” mode, it has the same speed of cython. I did test it with some C code which is creating a window and buttons. But I checked my Odin dll with cffi also. That was in “ABI-out of line” mode. It runs almost near to cpython with ctypes speed. But if something seems similar, I would vote for ease of use, and that’s ctypes. I have a gui lib in pure python with ctypes already. But I think, by using odin dll, I can make some serious speed differences.