▲ | nirw4nna 4 days ago | ||||||||||||||||
Yes, when I designed the API I wanted to keep a clear distinction between Python and C. At some point I had two APIs: 1 in Python and the other in high-level C++ and they both shared the same low-level C API. I find this design quite clean and easy to work with if multiple languages are involved. When I'll get to perf I plan to experiment a bit with nanobind (https://github.com/wjakob/nanobind) and see if there's a noticeable difference wrt ctypes. | |||||||||||||||||
▲ | almostgotcaught 4 days ago | parent [-] | ||||||||||||||||
The call overhead of using ctypes vs nanobind/pybind is enormous https://news.ycombinator.com/item?id=31378277 Even if the number reported there is off, it's not far off because ctypes just calls out to libffi which is known to be the slowest way to do ffi. | |||||||||||||||||
|