Re: [PATCH 1/6] t0080: move expected output to a file
- From
Jeff King <peff@peff.net>
- Date
- Jul 2, 2024, 00:57 UTC
- Message-ID
- <20240702005743.GB27170@coredump.intra.peff.net>
- In-Reply-To
- <xmqqcynwu1h6.fsf@gitster.g>
On Mon, Jul 01, 2024 at 04:38:45PM -0700, Junio C Hamano wrote:
Show 11 quoted lines
> > I just (re-)posted it in: > > > > https://lore.kernel.org/git/20240701220815.GA20293@coredump.intra.peff.net/ > > > > so you can see the improvement in some other real cases. > > ;-) > > The shells we care about (and that does not include the /bin/sh on > ancient Solaris ☹) should be OK, but "IFS= read -r line" somehow > makes me feel nervous. Maybe I am superstitious.
I don't know offhand of any case where it will fail. I'd prefer to start with it and see if it bites us, given that it saves us a process invocation per test (and those do add up in some cases).
I also wondered if we might be able to save the syscall-per-byte overhead of "read" for some shells (since we know we are reading until EOF anyway). Using "read -N" with bash would let us do that, but obviously we'd still need to fall back to regular "read" for other shells. I don't think it's worth the complexity unless we can really show a measurable speedup (and I didn't seem to see one).
-Peff