-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CI ByteString is slow #23
Comments
Since we have to construct a new ByteString to foldCase the original we can't avoid asking for pinned memory. What we could do is add an |
OK, I'll send one. please reopen to track this. BTW, what's the purpose of this rewrite rule?
|
For some reason that RULE made the benchmark faster. |
What if we implemented type family FoldedCase a where
FoldedCase B.ByteString = Short.ShortByteString
FoldedCase BL.ByteString = [Short.ShortByteString]
FoldedCase T.Text = T.Text
FoldedCase TL.Text = TL.Text
data CI s = CI { original :: !s -- ^ Retrieve the original string-like value.
, foldedCase :: !(FoldedCase s) -- ^ Retrieve the case folded string-like value.
-- (Also see 'foldCase').
} Another reason i propose this solution is that the document of |
Another approach is to provide a |
Constructing a
CI ByteString
will ask for pinned memory, but usually theByteString
is short so this behavior not only add overhead but contribute to heap fragment. I think we can do better here, any idea?The text was updated successfully, but these errors were encountered: