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

fast bytestring building #31

Open
jamesdbrock opened this issue May 24, 2020 · 1 comment
Open

fast bytestring building #31

jamesdbrock opened this issue May 24, 2020 · 1 comment

Comments

@jamesdbrock
Copy link
Member

https://hackage.haskell.org/package/bytestring-tree-builder

According to the benchmarks this builder implementation beats all the alternatives. It is especially well-suited for generating strict bytestrings, beating the standard builder by at least the factor of 4.

@jamesdbrock
Copy link
Member Author

jamesdbrock commented May 24, 2020

I'm not sure that bytestring-tree-builder is better than ByteString mconcat.

Maybe we should have a documentation section about making a lazy builder version of streamEditT. “If you want to construct the replaced stream as a lazy builder, consider using splitCap directly instead of using streamEditT. Write your pattern-matching parser sep so that it returns a Builder of your choice. Then build the output stream from the [Either ByteString Builder] list produced by splitCap. You should be able to efficiently build from the strict Left ByteString sections, as they are essentially just a pair of offsets delimiting a section of the input ByteString.”

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

1 participant