On Tue, Feb 8, 2011 at 10:39 AM, C K Kashyap <[email protected]> wrote: >> >> 1) Just use Data.Word.Word8 instead of the second Int in your type sig >> for IOArray >> 2) Use getElems to get a [Word8] >> 3) Data.ByteString.pack converts a [Word8] into a ByteString >> >> Michael > > I am currently using a list of tuples - [(Int,Int,Int)] to represent an > image buffer. You can see it in the getImageByteString > function at https://github.com/ckkashyap/Chitra/blob/master/RFB/Encoding.hs > Looks like this is pretty slow, and hence I am exploring Arrays. > I wonder if working with [Word8] will also suffer from performance hit? > Regards, > Kashyap
Using Data.ByteString.Internal.create along with readArray to fill in the contents seems like it would be a fast option (though I haven't tried it). > _______________________________________________ > Haskell-Cafe mailing list > [email protected] > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -- Work is punishment for failing to procrastinate effectively. _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
