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

Implement stream fusion? #81

Closed
SeanRBurton opened this issue Jun 7, 2016 · 1 comment
Closed

Implement stream fusion? #81

SeanRBurton opened this issue Jun 7, 2016 · 1 comment

Comments

@SeanRBurton
Copy link
Contributor

@SeanRBurton SeanRBurton commented Jun 7, 2016

Is there any particular reason that some form of fusion (either foldr/build or full stream fusion) is not implemented for this module? It might even be useful to use Vector-style bundles so mutation and C functions (memcpy et al.) can be used where appropriate.

I'm willing to work on this if it's considered a worthwhile feature.

@dcoutts
Copy link
Contributor

@dcoutts dcoutts commented Sep 1, 2016

We originally developed stream fusion in the context of bytestring and lazy bytestring, but in practice I think it's not a good fit for either ByteString or Text, but is for Vector, simply because in practice given what you use ByteString and Text text for there are not many opportunities to fuse things profitably, and there's lots of opportunity to mess things up and make things go slower (I can point out example where Text goes asymptotically slower when things are allowed to fuse).

So basically, no, we thought about it, even implemented it, and it's a bad idea :-)

@dcoutts dcoutts closed this as completed Sep 1, 2016
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