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

Introduce IO::DEFAULT_BUFFER_SIZE #12507

Conversation

straight-shoota
Copy link
Member

As a result of the discussion in https://forum.crystal-lang.org/t/io-copy-buffer-too-small/1873, this patch introduces a constant IO::DEFAULT_BUFFER_SIZE which holds the default size of a generic stream buffer.
This size is also increased from 4K (most IO operations) and 8K (IO::Buffered) to 32K which should be a good default for modern machines.

@straight-shoota straight-shoota force-pushed the feature/IO-DEFAULT_BUFFER_SIZE branch from 1902d0b to 1888445 Compare September 20, 2022 13:31
@straight-shoota
Copy link
Member Author

Sorry for the force push. I had only checked the explicit IO specs locally (which were all good). But there were some hard coded references to the buffer size in related specs (HTTP and Unix socket). Now I fixed that and it was better to do a force push to ensure the refactored spec works with the old as well as the increased buffer size.

@straight-shoota straight-shoota added this to the 1.6.0 milestone Sep 21, 2022
@straight-shoota straight-shoota merged commit 282e6e2 into crystal-lang:master Sep 22, 2022
@straight-shoota straight-shoota deleted the feature/IO-DEFAULT_BUFFER_SIZE branch September 22, 2022 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants