getting a Binary module into the standard libs

Simon Marlow
Thu, 19 Dec 2002 09:49:06 -0000

> I tend to agree with Alastair.  I just reran the experiments=20
> with BinIOs
> instead of BinMems to see if there was a greater difference=20
> (I expect a
> much smaller difference, in fact, due to the high disk=20
> overhead and the
> fact that putChar is slow).  I didn't both with -O0, but with=20
> -O2, we get:
>   bits   read     2156
>          write    2639
>   bytes  read     1617
>          write    2078
> frankly, this shocks me.  reading using bits is 33% slower; writing is
> about 27% slower.  i actually expected the bits version to be *faster*
> (relatively, of course) here, due to the fact that we have=20
> much smaller
> files (the byte-based file is 4200000 bytes while the=20
> bit-based file is
> 3325000 bytes).  With a 33% difference, I think I might want separate
> instances again :).

Try profiling.  It's hard to tell where the speed is going without
seeing the code - would you like to put it up somewhere so we can take a
look? =20

Remember that putByte and friends have been carefully tuned, I suspect
we'll need to take a close look at the compiler output for your bit
versions and tweak a few things.