getting a Binary module into the standard libs

Simon Marlow simonmar@microsoft.com
Fri, 20 Dec 2002 11:27:34 -0000


This is a multi-part message in MIME format.

------_=_NextPart_001_01C2A81A.CB0E0025
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

> In response to the two suggestions, I've linked my directory to:
>=20
>   http://www.isi.edu/~hdaume/haskell/NewBinary

I've made one or two small changes, the new version is attached.

Summary: according to my rough measurements, the byte version is 2.5
times faster than the bit version (using your SpeedTest{Bits,Bytes},
with BinMem rather than BinIO).

Compile it with -O -funbox-strict-fields.  The library was designed with
-funbox-strict-fields in mind (sorry I should have put a prominent
comment to that effect somewhere in the source).  It makes a *big*
difference, especially to BinMem.

> In there you will find FastMutInt, which is (almost)=20
> unchanged, Binary.hs
> which contains the new bit-based stuff, and a few test=20
> programs.  You will
> also find profiles for bits and bytes (only 100000 elements=20
> this time, but
> there's still a huge discrepancy between bits and bytes) in:
>=20
>   bits_io_p.prof
>   bytes_io_p.prof
>=20
> One thing that immediately surprises me looking at the=20
> profile information
> is that the bits version allocates 200m more heap than the=20
> bytes version.

The discrepancy is still about 200M with my version.  I haven't delved
into the code that the compiler generates for putBits yet, so I imagine
we can probably cut this down by quite a bit.  The idea is that putBits
should allocate nothing (I believe putWord8 has that property).

> I have a function in FastMutInt for or-ing them.  The comment=20
> next to it
> says "we should optimize this: ask SimonM :)", so I am asking SimonM
> now for a version which looks like incFastMutIntBy and hopefully uses
> unboxed or.  Nevertheless, this only accounts for 1% of the=20
> time, so it's probably not a big deal.

These functions are fine, the compiler does a good job here.
=20
I'll take a closer look if I get a chance later.

Cheers,
	Simon

------_=_NextPart_001_01C2A81A.CB0E0025
Content-Type: application/octet-stream;
	name="Binary.hs"
Content-Transfer-Encoding: base64
Content-Description: Binary.hs
Content-Disposition: attachment;
	filename="Binary.hs"

ey0jIE9QVElPTlMgLWNwcCAjLX0KLS0KLS0gKGMpIFRoZSBVbml2ZXJzaXR5IG9mIEdsYXNnb3cg
MjAwMg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XRJbnQgaXhfciBwCiAgd3JpdGVGYXN0TXV0SW50IG8gMAogIHdyaXRlRmFzdE11dEludCBjIDAK
ICBoU2VlayBoIEFic29sdXRlU2VlayAoZnJvbUludGVncmFsIHApCiAgd2hlbiAoYml0IC89IDAp
ICQgZ2V0Qml0cyBiaCBiaXQgPj4gcmV0dXJuICgpCiAgcmV0dXJuICgpCnNlZWtCaW4gaEAoQmlu
TWVtIGl4X3Igc3pfciBhIG8gYykgKEJpblB0ciBwIGJpdCkgPSBkbwogIHN6IDwtIHJlYWRGYXN0
TXV0SW50IHN6X3IKICBpZiAocCA+PSBzeikKCXRoZW4gZG8gZXhwYW5kQmluIGggcAogICAgICAg
ICAgICAgICAgd3JpdGVGYXN0TXV0SW50IGl4X3IgcAogICAgICAgICAgICAgICAgd3JpdGVGYXN0
TXV0SW50IG8gMAogICAgICAgICAgICAgICAgd3JpdGVGYXN0TXV0SW50IGMgMAogICAgICAgICAg
ICAgICAgd2hlbiAoYml0IC89IDApICQgZ2V0Qml0cyBoIGJpdCA+PiByZXR1cm4gKCkKICAgICAg
ICAgICAgICAgIHJldHVybiAoKQoJZWxzZSBkbyB3cml0ZUZhc3RNdXRJbnQgaXhfciBwCiAgICAg
ICAgICAgICAgICB3cml0ZUZhc3RNdXRJbnQgbyAwCiAgICAgICAgICAgICAgICB3cml0ZUZhc3RN
dXRJbnQgYyAwCiAgICAgICAgICAgICAgICB3aGVuIChiaXQgLz0gMCkgJCBnZXRCaXRzIGggYml0
ID4+IHJldHVybiAoKQogICAgICAgICAgICAgICAgcmV0dXJuICgpCgppc0VPRkJpbiA6OiBCaW5I
YW5kbGUgLT4gSU8gQm9vbAppc0VPRkJpbiAoQmluTWVtIGl4X3Igc3pfciBhIF8gXykgPSBkbwog
IGl4IDwtIHJlYWRGYXN0TXV0SW50IGl4X3IKICBzeiA8LSByZWFkRmFzdE11dEludCBzel9yCiAg
cmV0dXJuIChpeCA+PSBzeikKaXNFT0ZCaW4gKEJpbklPIGl4X3I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KICAgICAgICAgICAgICAgICAgICB8IG51bV9iaXRzIDwgIDAgPSBlcnJvciAiZ2V0Qml0
cyBjYW5ub3QgcmVhZCBuZWdhdGl2ZSBudW1iZXJzIG9mIGJpdHMiCiAgICAgICAgICAgICAgICAg
ICAgfCBudW1fYml0cyA+ICA4ID0gZXJyb3IgImdldEJpdHMgY2Fubm90IHJlYWQgbW9yZSB0aGFu
IDggYml0cyBhdCBhIHRpbWUiCiAgICAgICAgICAgICAgICAgICAgfCBvdGhlcndpc2UgICAgIC19
ID0gZG8KICBiaXRfb2ZmIDwtIHJlYWRGYXN0TXV0SW50IChiaXRfb2ZmX3IgYmgpCiAgaWYgYml0
X29mZiA9PSAwCiAgICB0aGVuIGRvIGJpdF9jYWNoZSA8LSBnZXRCeXRlIGJoCiAgICAgICAgICAg
IGlmIG51bV9iaXRzID09IDgKICAgICAgICAgICAgICB0aGVuIGRvIHdyaXRlRmFzdE11dEludCAo
Yml0X29mZl9yICAgYmgpIDAKICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRmFzdE11dEludCAo
Yml0X2NhY2hlX3IgYmgpIDAKICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBiaXRfY2FjaGUK
ICAgICAgICAgICAgICBlbHNlIGRvIHdyaXRlRmFzdE11dEludCAoYml0X29mZl9yICAgYmgpIChm
cm9tSW50ZWdyYWwgbnVtX2JpdHMpCiAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZhc3RNdXRJ
bnQgKGJpdF9jYWNoZV9yIGJoKSAoZnJvbUludGVncmFsIGJpdF9jYWNoZSkKICAgICAgICAgICAg
ICAgICAgICAgIHJldHVybiAoYml0X2NhY2hlIC4mLiBiaXRfbWFzayBudW1fYml0cykKICAgIGVs
c2UgaWYgYml0X29mZiArIG51bV9iaXRzIDwgOAogICAgdGhlbiBkbyBpbmNGYXN0TXV0SW50Qnkg
KGJpdF9vZmZfciBiaCkgbnVtX2JpdHMKICAgICAgICAgICAgYml0X2NhY2hlIDwtIHJ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LSAgICBnZXRGIGJoICAgPSBn
ZXRCaXRzRiBiaCAzMgoKey0KaW5zdGFuY2UgQmluYXJ5IGEgPT4gQmluYXJ5IFthXSB3aGVyZQog
ICAgcHV0XyBiaCBbXSAgICAgPSBwdXRCeXRlIGJoIDAKICAgIHB1dF8gYmggKHg6eHMpID0gZG8g
cHV0Qnl0ZSBiaCAxOyBwdXRfIGJoIHg7IHB1dF8gYmggeHMKICAgIGdldCBiaCAgICAgICAgID0g
ZG8gaCA8LSBnZXRXb3JkOCBiaAogICAgICAgICAgICAgICAgICAgICAgICBjYXNlIGggb2YKICAg
ICAgICAgICAgICAgICAgICAgICAgICAwIC0+IHJldHVybiBbXQogICAgICAgICAgICAgICAgICAg
ICAgICAgIF8gLT4gZG8geCAgPC0gZ2V0IGJoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICB4cyA8LSBnZXQgYmgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVy
biAoeDp4cykKLX0KaW5zdGFuY2UgQmluYXJ5IGEgPT4gQmluYXJ5IFthXSB3aGVyZQogICAgcHV0
XyBiaCBsID0KCWRvIHB1dF8gYmggKGxlbmd0aCBsKQoJICAgbWFwTSAocHV0XyBiaCkgbAoJICAg
cmV0dXJuICgpCiAgICBnZXQgYmggPQoJZG8gbGVuIDwtIGdldCBiaAoJICAgbWFwTSAoXF8gLT4g
Z2V0IGJoKSBbMS4uKGxlbjo6SW50KV0KCmluc3RhbmNlIChCaW5hcnkgYSwgQmluYXJ5IGIpID0+
IEJpbmFyeSAoYSxiKSB3aGVyZQogICAgcHV0XyBiaCAoYSxiKSA9IGRvIHB1dF8gYmggYTsgcHV0
XyBiaCBiCiAgICBnZXQgYmggICAgICAgID0gZG8gYSA8LSBnZXQgYmgKICAgICAgICAgICAgICAg
ICAgICAgICBiIDwtIGdldCBiaAogICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAoYSxiKQoK
aW5zdGFuY2UgKEJpbmFyeSBhLC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gYmgK
ICAgICAgICAgICAgICAgICAgICAgICAgIGMgPC0gZ2V0IGJoCiAgICAgICAgICAgICAgICAgICAg
ICAgICBkIDwtIGdldCBiaAogICAgICAgICAgICAgICAgICAgICAgICAgZSA8LSBnZXQgYmgKICAg
ICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAoYSxiLGMsZCxlKQoKaW5zdGFuY2UgKEJpbmFy
eSBhLCBCaW5hcnkgYiwgQmluYXJ5IGMsIEJpbmFyeSBkLCBCaW5hcnkgZSwgQmluYXJ5IGYpID0+
IEJpbmFyeSAoYSxiLGMsZCxlLGYpIHdoZXJlCiAgICBwdXRfIGJoIChhLGIsYyxkLGUsZikgPSBk
byBwdXRfIGJoIGE7IHB1dF8gYmggYjsgcHV0XyBiaCBjOyBwdXRfIGJoIGQ7IHB1dF8gYmggZTsg
cHV0XyBiaCBmCiAgICBnZXQgYmggICAgICAgICAgPSBkbyBhIDwtIGdldCBiaAogICAgICAgICAg
ICAgICAgICAgICAgICAgYiA8LSBnZXQgYmgKICAgICAgICAgICAgICAgICAgICAgICAgIGMgPC0g
Z2V0IGJoCiAgICAgICAgICAgICAgICAgICAgICAgICBkIDwtIGdldCBiaAogICAgICAgICAgICAg
ICAgICAgICAgICAgZSA8LSBnZXQgYmgKICAgICAgICAgICAgICAgICAgICAgICAgIGYgPC0gZ2V0
IGJoCiAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKGEsYixjLGQsZSxmKQoKaW5zdGFu
Y2UgQmluYXJ5IGEgPT4gQmluYXJ5IChNYXliZSBhKSB3aGVyZQogICAgcHV0XyBiaCBOb3RoaW5n
ICA9IHB1dEJ5dGUgYmggMAogICAgcHV0XyBiaCAoSnVzdCBhKSA9IGRvIHB1dEJ5dGUgYmggMTsg
cHV0XyBiaCBhCiAgICBnZXQgYmggICAgICAgICAgID0gZG8gaCA8LSBnZXRXb3JkOCBiaAogICAg
ICAgICAgICAgICAgICAgICAgICAgIGNhc2UgaCBvZgogICAgICAgICAg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