
On 09 November 2004 17:04, Duncan Coutts wrote:
Are you using BinMem, or BinIO?
BinIO
Aaaaah. BinIO is going to be a lot slower than BinMem, because it does an hPutChar for each character, whereas BinMem just writes into an array. I never really optimised the BinIO path, because we use BinMem exclusively in GHC. Cheers, Simon

"Simon Marlow"
On 09 November 2004 17:04, Duncan Coutts wrote:
Are you using BinMem, or BinIO?
BinIO
Aaaaah. BinIO is going to be a lot slower than BinMem, because it does an hPutChar for each character, whereas BinMem just writes into an array. I never really optimised the BinIO path, because we use BinMem exclusively in GHC.
Is there a method in your Binary library to freeze a BinMem into a file all in one go? The original nhc98 Binary library allows this (`copyBin'). Regards, Malcolm

On Wed, Nov 10, 2004 at 10:07:46AM +0000, Malcolm Wallace wrote:
"Simon Marlow"
writes: On 09 November 2004 17:04, Duncan Coutts wrote:
Are you using BinMem, or BinIO?
BinIO
Aaaaah. BinIO is going to be a lot slower than BinMem, because it does an hPutChar for each character, whereas BinMem just writes into an array. I never really optimised the BinIO path, because we use BinMem exclusively in GHC.
I have also done a port of the binary library to ghc6 as part of my ginsu project and done some work on improving its efficiency, in addition I have updated DrIFT such that it can derive both the old bitwise nhc style binary as well as the new ghc style byte based binary. (the byte based version which I use in ginsu is signifigantly faster). The code can be gotten from ginsu in http://repetae.net/computer/ginsu/ I also have a much improved PackedString based on raw UTF8 in memory with optimized unboxed folding routines which is designed to be very fast to serialize with Binary. In ginsu, a switch from String -> PackedString changed my memory footprint from 200megs to 10. quite a nice improvement. John -- John Meacham - ⑆repetae.net⑆john⑈
participants (3)
-
John Meacham
-
Malcolm Wallace
-
Simon Marlow