[Top][All Lists]

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

Re: cygwin xargs limitation: ARG_MAX depends on command

From: Eric Blake
Subject: Re: cygwin xargs limitation: ARG_MAX depends on command
Date: Mon, 05 Sep 2005 16:38:39 -0600
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

Hash: SHA1

According to Bob Proulx on 9/5/2005 3:33 PM:
>   (export TIMEFORMAT='real %3lR  user %3lU  sys %3lS'
>   for i in 1024 2048 4096 8192 16384 20480; do
>     printf "timing $i: "
>     yes | head --bytes=10m | bash -c "time xargs -s$i /bin/echo > /dev/null"
>   done)

On cygwin, WinXP 2.4 GHz:
timing 1024: real 3m41.694s  user 5m58.380s  sys 1m46.517s
timing 2048: real 1m59.541s  user 3m4.843s  sys 0m53.707s
timing 4096: real 2m1.248s  user 3m4.575s  sys 0m53.473s
timing 8192: real 2m4.677s  user 3m4.530s  sys 0m51.973s
timing 16384: real 1m58.561s  user 3m4.078s  sys 0m53.665s
timing 20480: real 2m2.826s  user 3m3.465s  sys 0m54.078s

> It just very quickly does not matter.  Let me guess, without data and
> perhaps wrongly, that this will not be a big performance difference on
> cygwin either.  So probably on cygwin I would go ahead and make that
> size restriction so that it works correctly all of the time.  But I am
> not mothering over that platform and I know that those that do will
> want to do better so personally I sympathize.  But it just does not
> seem to me like a performance lever.

Cygwin has the problem of all Windows implementations - namely that fork()
is VERY expensive (as it does not map well to underlying Windows API).
Reducing the number of processes spawned has been shown to provide
noticeable speedups in some cases.  But you are right that for large
argument lists, process startup can be dwarfed by the actual task you are
performing on the large list, regardless of whether you reduce the number
of spawned processes in half by doubling each process's command line
length.  So based on the benchmark numbers above, you have convinced me
that it is probably not worth the effort for a cygwin patch to xargs to
try to go beyond 32k, even when it is otherwise possible.

- --
Life is short - so eat dessert first!

Eric Blake             address@hidden
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org


reply via email to

[Prev in Thread] Current Thread [Next in Thread]