Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Nov 2003 23:16:07 -0700 (MST)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        sam@errno.com
Cc:        gallatin@cs.duke.edu
Subject:   Re: 40% slowdown with dynamic /bin/sh
Message-ID:  <20031124.231607.128865107.imp@bsdimp.com>
In-Reply-To: <200311242125.13786.sam@errno.com>
References:  <20031124.191931.67791612.imp@bsdimp.com> <16322.50980.825349.898362@grasshopper.cs.duke.edu> <200311242125.13786.sam@errno.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> And I just did a "make clean" run in /usr/ports/archivers (by manually
> mv'ing a static and dynamic sh to /bin in turn):
>
> static:       96.63 real        53.45 user        39.27 sys
> dynamic:     112.42 real        55.51 user        51.62 sys
>
> The wall clock is bad (16% worse) and the system time is worse (31%).

So all the worstness is in system time, or nealy all.  However, you
rant this test only once.

: >
: > So..
: >
: > 1) Microbenchmark:	40% worse
: > 2) Bootstone(*):	25% worse
: > 3) Ports:		16% worse

Hmmmm, It looks like the hit is less than 10% in the fork intensive
test I just wrote:

#!/bin/sh
for i in 0 1 2 3 4 5 6 7 8 9; do
    for j in 0 1 2 3 4 5 6 7 8 9; do
        for k in 0 1 2 3 4 5 6 7 8 9; do
             for l in 0 1 2 3 4 5 6 7 8 9; do
                 for m in 0 1 2 3 4 5 6 7 8 9; do
                      for n in 0 1 2 3 4 5 6 7 8 9; do
                        true;
done; done; done; done; done; done;

Here's the numbers I got:

x sh-s static sh
+ sh-d dynamic sh
+--------------------------------------------------------------------------+
|    x      x                                                      +       |
|    x      x                                   +                  +       |
|    x  x   x   x                               +   +              +       |
|    x  x   x   x                               +   +   +      +   +  +    |
|x   x  x   x   x                               +   +   +  +   +   +  +   +|
|    |___A__M_|                                    |________A__M____|      |
+--------------------------------------------------------------------------+
    N           Min           Max        Median           Avg        Stddev
x  20          1.27          1.31           1.3        1.2925   0.012085224
+  20           1.4          1.47          1.44         1.431   0.023597502
Difference at 95.0% confidence
        0.1385 +/- 0.0119989
        10.7157% +/- 0.928346%
        (Student's t, pooled s = 0.0187469)

As you can see, I ran each of the tests 10 times.  I timed it using a
the tcsh time built-in.  I ran each command once before I started
timing the commands to reduce cache effects.

Clearly dynamic is slower, but it is more like 11% slower (10.67%) on
the average than 40% slower.  I think this would be a more typical
usage pattern.

So things are a little bad, but it isn't the end of the world,
especially for a 5.2-beta that's going out.

Warner



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031124.231607.128865107.imp>