Hello Haskellers,
I'm playing a bit with Data.Judy. However, I noticed that using StablePtr incurs in some performance problems, I don't have any numbers but as a example use Int and ByteString as values and you can notice the difference without any benchmarking tool with the example that comes in the documentation.
The question that I have is: is there any way to make it faster for types other than those that fits in word size? I understand that the way the binding to the C code has been done, stableptr is required. Am I wrong assuming this? I would be happy to submit a patch but I failed to find a way to improve the performance.
The second question is what is a common practice to avoid memory leaks with StablePtr? I have zero experience programming with the Haskell FFI interface, so probably the most basic stuff would help me a lot in this case.