Looing for advice on profiling

2004-11-09 Thread Duncan Coutts
Hi all, I'm looking for some advice on profiling and any suggestion on what might be going on with this program. I'm profiling c2hs, Manuel Chakravarty's FFI preprocessor with an eye to reducing its time and space usage. I'm also trying to add binary serialisation. c2hs basically works by

RE: proposal for ghc-pkg to use a directory of .conf files

2004-11-09 Thread Simon Marlow
On 08 November 2004 18:47, Duncan Coutts wrote: We can use ghc-pkg at the build / install-into-temp phase to create the $(package).conf files under $TMP_INSTALL_ROOT/usr/lib/ghc-$VER/package.conf.d/ and then final installation is jsut merging files without any post-install calls to ghc-pkg

Re: Looing for advice on profiling

2004-11-09 Thread Malcolm Wallace
Duncan Coutts [EMAIL PROTECTED] writes: I'm looking for some advice on profiling and any suggestion on what might be going on with this program. One suggestion might be to serialise (key,value) pairs to file as they are first encountered, rather than waiting until they are all inside

RE: Looing for advice on profiling

2004-11-09 Thread Simon Marlow
On 09 November 2004 12:54, Duncan Coutts wrote: [snip] When I do time profiling, the big cost centres come up as putByte and putWord. When I profile for space it shows the large FiniteMaps dominating most everything else. I originally guessed from that that the serialisation must be forcing

Export through FFI Haskell List to C array (by MarshalAlloc)

2004-11-09 Thread David Lo
Dear all, Anyone has ever tried exporting Haskell list to C array ? I read in the FFI for MarshalAlloc, it is mentioned that Haskell lists are typically passed as C arrays to C functions. However, how can we do that ? I have a list of Int (i.e. [Int]) which I would like to pass as int[] in C.

Re: Export through FFI Haskell List to C array (by MarshalAlloc)

2004-11-09 Thread Peter Simons
David Lo writes: Anyone has ever tried exporting Haskell list to C array? Check out the module Foreign.Marshal.Array, specifically the functions: withArray:: Storable a = [a] - (Ptr a - IO b) - IO b withArrayLen :: Storable a = [a] - (Int - Ptr a - IO b) - IO b These will marshal a

RE: GHC CVS HEAD bug!

2004-11-09 Thread Simon Peyton-Jones
Good point. I've fixed this (HEAD only), and added a test so it won't recur. Thanks! Simon | -Original Message- | From: [EMAIL PROTECTED] [mailto:glasgow-haskell-users- | [EMAIL PROTECTED] On Behalf Of Keean Schupke | Sent: 03 November 2004 10:08 | To: [EMAIL PROTECTED] | Subject: GHC

RE: Looing for advice on profiling

2004-11-09 Thread Duncan Coutts
On Tue, 2004-11-09 at 14:45, Simon Marlow wrote: On 09 November 2004 12:54, Duncan Coutts wrote: [snip] When I do time profiling, the big cost centres come up as putByte and putWord. When I profile for space it shows the large FiniteMaps dominating most everything else. I originally