
26 Jan
2013
26 Jan
'13
1:57 p.m.
On 26 January 2013 19:31, Bas van Dijk
Any ideas how to improve this?
It also doesn't help using a rewrite rule to not go via the type class: {-# RULES "mk/ByteString" forall (bs :: B.ByteString). mk bs = CI bs (B.map toLower8 bs) #-} and modifying the benchmark so that the rule fires: ... , bench "case-insensitive" $ nf f bs ... f :: ByteString -> CI.CI ByteString f bs = CI.mk bs What does help a bit is inlining toLower8 in Data.CaseInsensitive. But with that it's still 44% slower than the no-class benchmark. Bas