Gentoo Archives: gentoo-dev

From: Steve Long <slong@××××××××××××××××××.uk>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Re: Re: Re: [gentoo-commits] gentoo-x86 commit in app-misc/note: ChangeLog note-1.3.3.ebuild
Date: Tue, 16 Oct 2007 02:24:07
Message-Id: ff16ib$t43$1@ger.gmane.org
In Reply to: Re: [gentoo-dev] Re: Re: [gentoo-commits] gentoo-x86 commit in app-misc/note: ChangeLog note-1.3.3.ebuild by Gilles Dartiguelongue
1 Gilles Dartiguelongue wrote:
2 > I haven't reread the fine mans for a while but iirc, + could lead you to
3 > hit the argument buffer limit of your shell. xargs has --max-args to get
4 > around that and is also way faster than any -exec variant (at least
5 > that's what the bench I did on a PIV2.6Ghz showed me about 4 months ago)
6 >
7 It doesn't: find will just execute the command as many times as needed (each
8 time with an argument length maximally less than ARG_MAX. Well, it did when
9 we tested this a couple of months ago.) So it's optimal in that sense. I
10 have no idea on the timing measurements, but I don't like pipes and
11 subshells as a rule (externals are bad enough!;>) It'd be interesting to
12 see measurements over 100000 loops with long argument lists requiring
13 multiple invocations per pass, I suppose.
14
15 An array expansion can lead to an argument length greater than ARG_MAX
16 however, eg funcToFix "${list[@]}"
17
18 (I'd be kind of perturbed if the last case were infeasible since it would
19 imply poor memory handling in BASH, and limit the scope of its usability.)
20
21
22 --
23 gentoo-dev@g.o mailing list

Replies