[Haskell-cafe] Marshalling

2010-07-13 Thread 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? Regards, Phyx

Re: [Haskell-cafe] Marshalling

2010-07-13 Thread Magnus Therning
On Tue, Jul 13, 2010 at 13:29, Phyx loneti...@gmail.com 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

Re: [Haskell-cafe] Marshalling

2010-07-13 Thread 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,

Re: [Haskell-cafe] Marshalling

2010-07-13 Thread Thomas DuBuisson
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

Re: [Haskell-cafe] Marshalling

2010-07-13 Thread Phyx
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

[Haskell-cafe] Marshalling arrays without flakiness?

2009-10-29 Thread Ron de Bruijn
Hi, I would like to know whether there is a good way to marshal the following structure to C without using pointer arithmetic done by a programmer (as opposed to a tool). typedef struct{ double a[10]; double b[10]; double b[10]; } foo; I don't need this

[Haskell-cafe] Marshalling recursive data structures with the FFI

2009-01-09 Thread Ron de Bruijn
Hi, A few days ago we published an article (http://gamr7.com/blog/?p=66) on using the FFI to marshal recursive data structures between Haskell and C (or Python if you use ctypes). Best regards, Ron de Bruijn ___ Haskell-Cafe mailing list