40% slowdown with dynamic /bin/sh

Peter Jeremy peterjeremy at optushome.com.au
Tue Nov 25 00:48:02 PST 2003

On Tue, Nov 25, 2003 at 01:17:34AM -0700, M. Warner Losh wrote:
>True.  However, I get very similar numbers of I change it to
>/usr/bin/true (12% slower).  /bin/sh usually fork+exec things other

That's a more interesting result and more comparable to Drew's test.
It doesn't necessarily invalidate Drew's results - /bin/sh has 3
shared libraries and is locale-aware whereas /usr/bin/test has 1
shared library and doesn't rely on the locale.  /usr/bin/true is also
significantly smaller (implying less relocation requirements).
/bin/sh could reasonably be expected to take longer to startup then

>Dynamically linked prorgrams tend to be a few percent slower than
>their static counterparts due to PIC code typically being slower than
>non-PIC code.  There's nothing new here.

Except that, on face value, your figures suggested an 11% slowdown
attribute to PIC code - which is way above "a few percent".

>Clearly there are problems to look into, but it isn't the end of the

Agreed.  I think most people agree that more work needs to be done.  The
arguing seems to be whether the work should be done before or after the
big switch is thrown and how to go about recovering the lost performance.
(And of course one contingent is insisting it be green whilst a different
contingent is insisting that it can't be green and has to be triangular


More information about the freebsd-current mailing list