
Hello I'm wondering if anyone ever benchmarked marshalling in Haskell/GHC. No matter how much I optimize my Haskell code my program still seems to run slow, which leads me to beleive that Marshalling is painfully slow. Does anyone know a way I can test this and fix it? Regards, Phyx

On Tue, Jul 13, 2010 at 13:29, Phyx
Hello
I'm wondering if anyone ever benchmarked marshalling in Haskell/GHC. No matter how much I optimize my Haskell code my program still seems to run slow, which leads me to beleive that Marshalling is painfully slow.
Does anyone know a way I can test this and fix it?
What kind of marshalling are you referring to? /M -- Magnus Therning (OpenPGP: 0xAB4DFBA4) magnus@therning.org Jabber: magnus@therning.org http://therning.org/magnus identi.ca|twitter: magthe

Marshalling large amount of data from and to C
http://phyx.pastebin.com/WXGBr1bX shows the code I use to do this (it's
autogenerated, so just looking at 1 block should be enough)
The tool is mine, so i can change the code it generates, but i would need to
know how to do it better first.
On Tue, Jul 13, 2010 at 3:30 PM, Magnus Therning
On Tue, Jul 13, 2010 at 13:29, Phyx
wrote: Hello
I'm wondering if anyone ever benchmarked marshalling in Haskell/GHC. No matter how much I optimize my Haskell code my program still seems to run slow, which leads me to beleive that Marshalling is painfully slow.
Does anyone know a way I can test this and fix it?
What kind of marshalling are you referring to?
/M
-- Magnus Therning (OpenPGP: 0xAB4DFBA4) magnus@therning.org Jabber: magnus@therning.org http://therning.org/magnus identi.ca|twitter: magthe

That code is effectively copying the data (thats what those peeks /
pokes do), so it stands to reason it would be slow by most performance
standards. The reason ByteStrings are fast when used both by C and
Haskell is there is a zero-copy `useAsCString`.
Cheers,
Thomas
On Tue, Jul 13, 2010 at 7:49 AM, Phyx
Marshalling large amount of data from and to C
http://phyx.pastebin.com/WXGBr1bX shows the code I use to do this (it's autogenerated, so just looking at 1 block should be enough)
The tool is mine, so i can change the code it generates, but i would need to know how to do it better first.
On Tue, Jul 13, 2010 at 3:30 PM, Magnus Therning
wrote: On Tue, Jul 13, 2010 at 13:29, Phyx
wrote: Hello
I'm wondering if anyone ever benchmarked marshalling in Haskell/GHC. No matter how much I optimize my Haskell code my program still seems to run slow, which leads me to beleive that Marshalling is painfully slow.
Does anyone know a way I can test this and fix it?
What kind of marshalling are you referring to?
/M
-- Magnus Therning (OpenPGP: 0xAB4DFBA4) magnus@therning.org Jabber: magnus@therning.org http://therning.org/magnus identi.ca|twitter: magthe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

I understand that part, but the strings are generated from SDocs, and So unless internally SDoc doesn't use String then I'm afraid there's nothing I can do about that :/ Or rather, Is there a way to efficiently make CWStrings from SDocs? Regards, Phyx On Tue, Jul 13, 2010 at 6:56 PM, Thomas DuBuisson < thomas.dubuisson@gmail.com> wrote:
That code is effectively copying the data (thats what those peeks / pokes do), so it stands to reason it would be slow by most performance standards. The reason ByteStrings are fast when used both by C and Haskell is there is a zero-copy `useAsCString`.
Cheers, Thomas
On Tue, Jul 13, 2010 at 7:49 AM, Phyx
wrote: Marshalling large amount of data from and to C
http://phyx.pastebin.com/WXGBr1bX shows the code I use to do this (it's autogenerated, so just looking at 1 block should be enough)
The tool is mine, so i can change the code it generates, but i would need to know how to do it better first.
On Tue, Jul 13, 2010 at 3:30 PM, Magnus Therning
wrote: On Tue, Jul 13, 2010 at 13:29, Phyx
wrote: Hello
I'm wondering if anyone ever benchmarked marshalling in Haskell/GHC.
No
matter how much I optimize my Haskell code my program still seems to run slow, which leads me to beleive that Marshalling is painfully slow.
Does anyone know a way I can test this and fix it?
What kind of marshalling are you referring to?
/M
-- Magnus Therning (OpenPGP: 0xAB4DFBA4) magnus@therning.org Jabber: magnus@therning.org http://therning.org/magnus identi.ca|twitter: magthe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (3)
-
Magnus Therning
-
Phyx
-
Thomas DuBuisson