Skip to content
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

Unnecessary use of strict bytestrings in Data.Acid.Log #166

Open
adamgundry opened this issue Nov 16, 2023 · 1 comment
Open

Unnecessary use of strict bytestrings in Data.Acid.Log #166

adamgundry opened this issue Nov 16, 2023 · 1 comment

Comments

@adamgundry
Copy link
Contributor

I happened across a couple of places where strict bytestrings are used seemingly unnecessarily (now):

-- XXX: Strict bytestrings are used due to a performance bug in
-- cereal-0.3.5.2 and binary-0.7.1.0. The code should revert back
-- to lazy bytestrings once the bug has been fixed.
archive <- liftM Lazy.fromChunks $ mapM (Strict.readFile . snd) relevant

-- XXX: Strict bytestrings are used due to a performance bug in
-- cereal-0.3.5.2 and binary-0.7.1.0. The code should revert back
-- to lazy bytestrings once the bug has been fixed.
archive <- fmap Lazy.fromStrict $ Strict.readFile logFile

This is somewhat similar to the issue from #125:

encoded = Lazy.fromChunks [ Strict.copy $ Lazy.toStrict $

@ddssff
Copy link
Collaborator

ddssff commented Nov 16, 2023

Maybe a version #ifdef would be the right thing here? Edit: actually the cabal file requires cereal >= 0.4.1, so nvm about that ifdef.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants