Subject: Re: Make readme slow in pkgsrc
To: Christoph Badura <bad@ora.de>
From: Brian C. Grayson <bgrayson@marvin.ece.utexas.edu>
List: netbsd-help
Date: 01/18/1999 01:00:07
> >"Stephen B. Salai" <bsalai@rochester.rr.comlaw.tmonline.com> writes:
> >> I just did a make readme in pkgsrc.devel. Not only did it take about
> >> half an hour, but my SS5 became almost unusably slow during that time,

  Unfortunately, "make readme" is a fork-intensive procedure.
Have you perhaps not updated your pkgsrc makefile stubs in a
while?  With a pkgsrc tree from around September, it took 1000
forks/processes(!!!) to create a _single_ README.html file.  I
filed a PR (5780) about this a while ago, but it appears that the
problem has been reduced -- it just now took only 2000
processes to do _all_ the README.html files under archivers --
that's only ~150 processes per README.

  To see how many forks it takes on your machine, create the
following utility program, countforks.  (It assumes no other
major forkers are active.)
-------------------
#!/bin/sh
$*
cat <<"EOF" > /tmp/pid.sh
echo $$
EOF
pid2=`sh /tmp/pid.sh && rm /tmp/pid.sh`
diff=$(($pid2 - $$ - 3))
echo $diff
-------------------

  Now, cd /usr/pkgsrc/archivers/arc.  Run "countforks make readme".
countforks runs the command, and figures out how many processes
have been spawned between when it started the command and when
the command completed.  I get 97 for arc with yesterday's sup,
but 1059 with a Sep4 version.  It took 12391 processes for
devel/ (and 4 minutes for a K6-200, with pkgsrc via NFS) with the
-current pkgsrc.

  I hope this helps!

  Brian