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

Make IO::Handle.Supply read character-by-character #5270

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Leont
Copy link
Contributor

@Leont Leont commented Jun 4, 2023

Otherwise it will only emit any data once 64k bytes are read, which means a construct like $handle.Supply.lines will not DWIM at all.

This fixes #5189. It's not terribly efficient but at least it's correct.

Otherwise it will only emit any data once 64k bytes are read, which
means a construct like $handle.Supply.lines will not DWIM at all.

This fixes rakudo#5189
@lizmat
Copy link
Contributor

lizmat commented Jun 13, 2023

Feels like 1 is the other end of the spectrum, making .Supply potentially useless performance wise?

@Leont
Copy link
Contributor Author

Leont commented Jun 13, 2023

Feels like 1 is the other end of the spectrum, making .Supply potentially useless performance wise?

Any other value would be wrong though.

The better solution would be to add a new read function to nqp/moarvm that has read(2) semantics instead of fread(3) semantics; a read_at_most_chars. That work would be of a different order of magnitude though.

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.

IO::Handle.Supply.lines blocks on buffer.
2 participants