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

Improved hPutStr lazy for small chunk sizes #592

Closed

Conversation

BebeSparkelSparkel
Copy link
Contributor

No description provided.

…it at length > 1000

unsure why need to profile to see why for <= 1000 charaters the performace increases by 20% but >= 10,000 the performance is terrible.
@Lysxia
Copy link
Contributor

Lysxia commented May 27, 2024

I think a simpler way is to decompose Text.hPutStr into \h -> Stream.hPutStr h . Text.stream (for some Stream.hPutStr :: Handle -> Stream Char -> IO ()) so you get Lazy.hPutStr h = Stream.hPutStr h . Lazy.stream.

@BebeSparkelSparkel
Copy link
Contributor Author

Thanks I was not aware of lazy stream.

@Lysxia
Copy link
Contributor

Lysxia commented May 29, 2024

While fixing #442 I ended up doing what I suggested here, in #600.

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

Successfully merging this pull request may close these issues.

None yet

2 participants