[Haskell-cafe] Significant compilation slowdown when using Data.CaseInsensitive.mk

Brendan Hay brendan.g.hay at gmail.com
Tue Jan 6 07:07:32 UTC 2015


I've recently run into an issue whereby changing textual case comparison
to use the Data.CaseInsensitive.mk
constructor causes substantial
differences to outputted core language and a related compilation speed

The code which seems to cause this is here:

With the downstream project having about 68 call sites for the above
function starting here:

For comparison, the previous version used Attoparsec.Text.takeText
and Text values.

Here are some hand wavy points of interest:

* Before (Case Sensitive)
Function: takeText = Attoparsec.Text.takeText
Time (real): 2m27.735s
amazonka-ec2/gen/Network/AWS/EC2/Types.hs (simpl): {terms: 242,688, types:
310,463, coercions: 31,215}

* After (Case Insensitive)
Function: takeCI = Data.CaseInsensitive.mk <$> Attoparsec.Text.takeText
Time (real): 11m31.937s
amazonka-ec2/gen/Network/AWS/EC2/Types.hs (simpl): {terms: 1,384,779,
types: 465,656, coercions: 33,510}

I'm finding the outputted core rather unwieldy to analyse, but the main
difference seems to be the inclusion of huge swathes of case statements

It would be appreciated if someone could help me to understand in simple
terms why
the use of case-insensitive causes this.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20150106/fac33427/attachment-0001.html>

More information about the Haskell-Cafe mailing list