On 2007-May-27 15:30:48 -0700, Jeremy Chadwick <[EMAIL PROTECTED]> wrote: >This sounds like a good solution. In fact, I'm lead to believe that >heavy reliance on /bin/sh is part of why the ports collection is slow.
Someone needs to enable accounting on a recent -current (with the high-resolution accounting records) and look at where the time is actually going. (My -current box needs upgrading before I could do this). That said, /bin/sh is dynamically linked and a fork/exec is not cheap. Some quick-and-not-necessarily-reliable tests on 6.2-STABLE/amd64 show that /bin/sh takes about 2.5 times as long to start as /rescue/sh (though it's only 2:1 on i386). (These are different boxes so the absolute times aren't comparable). amd64% time sh -c 'i=0; while [ $i -lt 10000 ]; do i=$(($i+1)); echo foo; done' >/dev/null sh -c 'i=0; while [ $i -lt 10000 ]; do i=$(($i+1)); echo foo; done' > 0.20s user 0.08s system 98% cpu 0.283 total amd64% time sh -c 'i=0; while [ $i -lt 10000 ]; do i=$(($i+1)); echo foo; done' >/dev/null sh -c 'i=0; while [ $i -lt 10000 ]; do i=$(($i+1)); echo foo; done' > 0.22s user 0.06s system 97% cpu 0.287 total amd64% time sh -c 'i=0; while [ $i -lt 10000 ]; do i=$(($i+1)); echo foo; done' >/dev/null sh -c 'i=0; while [ $i -lt 10000 ]; do i=$(($i+1)); echo foo; done' > 0.19s user 0.10s system 98% cpu 0.288 total amd64% time sh -c 'i=0; while [ $i -lt 10000 ]; do i=$(($i+1)); /rescue/sh -c "echo foo"; done' >/dev/null sh -c > /dev/null 0.84s user 6.12s system 97% cpu 7.162 total amd64% time sh -c 'i=0; while [ $i -lt 10000 ]; do i=$(($i+1)); /rescue/sh -c "echo foo"; done' >/dev/null sh -c > /dev/null 1.12s user 6.05s system 97% cpu 7.366 total amd64% time sh -c 'i=0; while [ $i -lt 10000 ]; do i=$(($i+1)); /bin/sh -c "echo foo"; done' >/dev/null sh -c > /dev/null 5.72s user 13.40s system 96% cpu 19.734 total amd64% time sh -c 'i=0; while [ $i -lt 10000 ]; do i=$(($i+1)); /bin/sh -c "echo foo"; done' >/dev/null sh -c > /dev/null 5.97s user 12.89s system 97% cpu 19.407 total amd64% i386% time sh -c 'i=0; while [ $i -lt 10000 ]; do i=$(($i+1)); echo foo; done' >/dev/null sh -c 'i=0; while [ $i -lt 10000 ]; do i=$(($i+1)); echo foo; done' > 0.17s user 0.03s system 95% cpu 0.208 total i386% time sh -c 'i=0; while [ $i -lt 10000 ]; do i=$(($i+1)); echo foo; done' >/dev/null sh -c 'i=0; while [ $i -lt 10000 ]; do i=$(($i+1)); echo foo; done' > 0.17s user 0.03s system 99% cpu 0.199 total i386% time sh -c 'i=0; while [ $i -lt 10000 ]; do i=$(($i+1)); echo foo; done' >/dev/null sh -c 'i=0; while [ $i -lt 10000 ]; do i=$(($i+1)); echo foo; done' > 0.16s user 0.04s system 99% cpu 0.200 total i386% time sh -c 'i=0; while [ $i -lt 10000 ]; do i=$(($i+1)); /rescue/sh -c "echo foo"; done' >/dev/null sh -c > /dev/null 3.68s user 18.19s system 98% cpu 22.212 total i386% time sh -c 'i=0; while [ $i -lt 10000 ]; do i=$(($i+1)); /rescue/sh -c "echo foo"; done' >/dev/null sh -c > /dev/null 3.34s user 18.54s system 98% cpu 22.110 total i386% time sh -c 'i=0; while [ $i -lt 10000 ]; do i=$(($i+1)); /bin/sh -c "echo foo"; done' >/dev/null sh -c > /dev/null 12.03s user 29.42s system 98% cpu 41.965 total i386% time sh -c 'i=0; while [ $i -lt 10000 ]; do i=$(($i+1)); /bin/sh -c "echo foo"; done' >/dev/null sh -c > /dev/null 12.20s user 29.25s system 98% cpu 41.975 total -- Peter Jeremy
pgpUpeOoZw3YV.pgp
Description: PGP signature