I want to use the Ctypes library but I get a result up to 30 times slower than the conventional method on the function that I tested. Does this seem normal and is it possible to optimize calls with Ctypes?
Of the two, bindings created using stub generation will typically be significantly faster.
I am using dynamic calls. I will try stub generation, thanks for the advice.
Cstubs, my function is as fast as the conventional one without the attribute
Is it possible to add the attribute
Most of the internal work to support
noalloc is in place, but I’ve been hesitant to enable it in the interface because there are some (probably very rare) edge cases involving C calling back into OCaml where it’s difficult to give guarantees.
There’s an issue open to track support for the feature.