How to use D without the GC ?
Vinod K Chandran
kcvinu82 at gmail.com
Wed Jun 12 20:26:19 UTC 2024
On Wednesday, 12 June 2024 at 18:58:49 UTC, evilrat wrote:
> the only problem is that it seems to leak a lot PydObjects so i
> have to manually free them, even scope doesn't helps with that
> which is sad.
>
Oh I see. I did some experiments with nimpy and pybind11. Both
experiments were resulted in slower than ctypes dll calling
method. That's why I didn't take much interest in binding with
Python C API. Even Cython is slower compare to ctypes. But it can
be used when we call the dll in Cython and call the cython code
from python. But then you will have to face some other obstacles.
In my case, callback functions are the reason. When using a dll
in cython, you need to pass a cython function as callback and
inside that func, you need to convert everything into pyobject
back and forth. That will take time. Imagine that you want to do
some heavy lifting in a mouse move event ? No one will be happy
with at snail's pace.
But yeah, Cython is a nice language and we can create an entire
gui lib in Cython but the execution speed is 2.5X slower than my
current c3 dll.
More information about the Digitalmars-d-learn
mailing list