Re: [PATCH v2 2/2] t1006: ensure cat-file info isn't buffered by default

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 21, 2024 at 08:00:02PM +0000, Eric Wong wrote:

> > We often use "perl -e" for one-liners, etc, but this is pretty big.
> > Maybe:
> > 
> >   cat >foo.pl <<-\EOF
> >   ...
> >   EOF
> >   perl foo.pl -- ...
> > 
> > would be more readable? To be clear I don't think there's anything
> > incorrect about your usage, but it would match the style of our suite a
> > bit better.
> 
> *shrug*  It doesn't save the nested quoting/expansion confusion;
> but it's Junio's call.  I don't think a v3 is worth the effort.

It does allow you to use single quotes in the script, though I think you
managed without it.

> > +test_expect_success PERL '--batch-check is unbuffered by default' '
> > +	echo "$hello_oid" |
> > +	perl run-and-wait.pl git cat-file --batch-check >out &&
> > +	echo "$hello_oid blob $hello_size" >expect &&
> > +	test_cmp expect out
> 
> I prefer to avoid process spawning overhead from test_cmp;
> but that's a small drop in a big bucket.

If we care about that, I'd rather see us make test_cmp zero-process with
a shell helper than come up with ad-hoc solutions. I've tried to measure
something like that before, but couldn't come up with any conclusive
improvements (my findings were mostly that running Git itself accounts
for most of the process overhead).

-Peff




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux