[Haskell-cafe] Data.Judy and StablePtr

Gregory Collins greg at gregorycollins.net
Mon Dec 20 17:40:46 CET 2010

Pointers are mapped to StablePtrs using.... *drumroll* a hash table,
so you can give up on getting acceptable performance out of this
combination IMO.


On Mon, Dec 20, 2010 at 5:06 PM, Diego Souza <dsouza at bitforest.org> wrote:
> 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.
> Thanks in advance,
> --
> ~dsouza
> yahoo!im: paravinicius
> gpg key fingerprint: 71B8 CE21 3A6E F894 5B1B  9ECE F88E 067F E891 651E
> gpg pub key: http://bitforest.org/~dsouza/pub/gpg-pubkey.txt
> authorized_keys: http://bitforest.org/~dsouza/pub/authorized_keys.txt
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

Gregory Collins <greg at gregorycollins.net>

More information about the Haskell-Cafe mailing list