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

Don't use streams and fusion #513

Open
oberblastmeister opened this issue Mar 24, 2023 · 2 comments
Open

Don't use streams and fusion #513

oberblastmeister opened this issue Mar 24, 2023 · 2 comments
Labels
internal No API-level changes performance

Comments

@oberblastmeister
Copy link
Contributor

The documentation states

Starting from @text-1.3@ fusion is no longer implicit

However, many functions still use Stream internally, even thought they would probably run a lot faster without it. It is much more efficient to work on the underlying bytes instead of decoding and encoding to and from UTF-32 through Stream. Some functions that use Stream include cons, snoc, and isPrefix.

@Bodigrim
Copy link
Contributor

I'm in favor. See also #510 (comment) for non-streaming folds.

@oberblastmeister
Copy link
Contributor Author

oberblastmeister commented Mar 25, 2023

I think folds should still use Stream, the issue there is that foldl should be defined as

foldl = S.foldr (flip f) z . reverseStream

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal No API-level changes performance
Projects
None yet
Development

No branches or pull requests

3 participants