Porges/stringprep-hs — pull request #3 by Philonous (2013-12-09 23:22:05+00:00)
Title: Successive improvements

Stringprep became a bottleneck for validating JIDs for QuickCheck-testing of pontarius-xmpp, so I harvested some low-hanging fruit. Specifically, profiling showed that merging ranges in the range package accounted for most of the run time, so I exchanged the O(n^2) merging algorithm for a O(n*log n) one. Since you deprecated ranges I also folded the relevant code into stringprep and specialized it to chars. I added a test to check that the new code and the old one behave the same.
Overall this yielded a 50-fold increase in speed for validating my test JID.