Proposal: add laziness to Data.Map / IntMap

Adrian Hey ahey at
Wed Aug 6 03:35:34 EDT 2008

Hello Scott,

Scott Dillard wrote:
> Thanks for chiming in Adrian. Just to get started I removed the strictness
> annotations from the Data.Map Bin constructor, made no other changes, and
> ran a
> silly benchmark (at the end of this email). The version without bangs is
> actually faster than the version currently shipping. I get about 10.5 sec
> for
> the lazy version and 11.5 sec for the strict version (2.1Ghz Intel Core)
> I'll repeat that in bold for people just skimming this thread:
> __Removing Strictness Annotations Makes It Go Faster__

Interesting. This seems to be more or less in agreement with my tests on
AVL insertion. I get something like 10-20% speedup by *not* using strict
constructors (providing I add explicit seqs if needed to give me the
strictness I want). So  it seems strict constructors cause some
unnecessary work or inhibit some optimisation (or something..).

Adrian Hey

More information about the Libraries mailing list