Re: Use of tee(2) to speedup reading from pipes
Sam James <[email protected]>
| Newsgroups | gmane.comp.shells.bash.bugs |
|---|---|
| Organization | Gentoo |
| Message-ID | <[email protected]> |
Sam James <[email protected]> writes: > Hi, > > bash currently probes a pipe w/ lseek, sees it isn't seekable, and then > falls back to reading 1 byte at a time. > > A few years ago, dash adopted [0] use of tee(2) to peek at the contents > of stdin and read the amount of bytes left instead rather than 1. > > Could this be considered for bash too? My interest in this is partly > speed but also to avoid a lot of noisy read()s of size 1 which can > obfuscate actual problems and can be hard to decipher (as you have to > concatenate the values from each line mentally). I found https://lists.gnu.org/archive/html/bug-bash/2021-05/msg00001.html as well after some more searching. > > [0] 44b15ea09a9ee5872cf477e4ffc6b42ef37d1e46 with some followups > afterwards in 1713d1d6592f09f23b5abfb4562cbe5a7615fb1a, > 41457be81fa7b45af9d9ca402454fee0e555620f, > and 0679594e72403f4a6d7890e627b75816f6feb0d5. > > thanks, > sam
signature.asc
(application/pgp-signature, 418 B)
-----BEGIN PGP SIGNATURE----- iQEBBAEWCgCpFiEEJaa7iN2bdkxrVUHCc4QJ9SDfkZAFAmqLeg0bFIAAAAAABAAO bWFudTIsMi41KzEuMTIsMiwyXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25z Lm9wZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQyNUE2QkI4OEREOUI3NjRDNkI1NTQx QzI3Mzg0MDlGNTIwREY5MTkwDxxzYW1AZ2VudG9vLm9yZwAKCRBzhAn1IN+RkDU+ AQChJ/CjJzHN+qDT4C946ccuaTKEMqXcsOS8HE1hBkOLvgEA6H+7RkjBXemaKQfs rdSQP60xGI9Bz6bdSRPh34keeg0= =jl13 -----END PGP SIGNATURE-----