[Haskell-cafe] Data.Judy and StablePtr
Diego Souza
dsouza at bitforest.org
Tue Dec 21 09:29:11 CET 2010
Thanks Gregory!
Probably the solution would be recreating the FFI in a way that doesn't need
the StablePtr. Not sure how to do this though. I'm going to test other
things, like HashTable, before trying this. And let's see how it goes.
~dsouza
On Mon, Dec 20, 2010 at 2:40 PM, Gregory Collins <greg at gregorycollins.net>wrote:
> Pointers are mapped to StablePtrs using.... *drumroll* a hash table,
> so you can give up on getting acceptable performance out of this
> combination IMO.
>
> G
>
> 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>
>
--
~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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20101221/2b12b548/attachment.htm>
More information about the Haskell-Cafe
mailing list