Fabian Homborg 9ada7d9aad read: Also read in chunks when directly redirected
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.
2022-03-13 11:22:48 +01:00
..
2021-11-11 16:46:23 +01:00
2020-02-08 13:30:48 +01:00
2019-06-26 21:19:40 +02:00
2020-01-19 15:07:06 +01:00
2021-02-15 17:08:26 +01:00
2021-06-23 21:30:10 +02:00
2020-12-29 12:48:11 +01:00
2020-02-17 11:39:53 +01:00
2021-07-21 22:33:39 +02:00
2019-07-09 10:02:50 -07:00
2021-06-24 18:17:10 +02:00
2021-06-24 20:46:03 +02:00
2021-12-13 01:24:47 -08:00
2022-02-21 22:48:43 +01:00
2021-03-02 14:53:02 +01:00
2020-03-16 21:21:10 +01:00
2021-06-24 18:17:10 +02:00