mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 13:23:09 +00:00
9ada7d9aad
We can't always read in chunks because we often can't bear to overread: ```fish echo foo\nbar | begin read -l foo read -l bar end ``` needs to have the first read read `foo` and the second read `bar`. So here we can only read one byte at a time. However, when we are directly redirected: ```fish echo foo | read foo ``` we can, because the data is only for us anyway. The stream will be closed after, so anything not read just goes away. Nobody else is there to read. This dramatically speeds up `read` of long lines through a pipe. How much depends on the length of the line. With lines of 5000 characters it's about 15x, with lines of 50 characters about 2x, lines of 5 characters about 1.07x. See #8542. |
||
---|---|---|
.. | ||
checks | ||
pexpects | ||
test_functions | ||
.gitignore | ||
history_sample_bash | ||
history_sample_corrupt1 | ||
history_sample_fish_1_x | ||
history_sample_fish_2_0 | ||
interactive.config | ||
interactive.fish | ||
test.fish | ||
test_driver.sh | ||
test_env.sh | ||
test_util.fish |