Re: 40% slowdown with dynamic /bin/sh

From: Peter Jeremy <peterjeremy_at_optushome.com.au>
Date: Tue, 25 Nov 2003 19:01:55 +1100
On Mon, Nov 24, 2003 at 11:16:07PM -0700, M. Warner Losh wrote:
>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;

Unless you've done something wierd to your /bin/sh, "true" is a
builtin.  This test just to measures the ongoing runtime overhead
of a dynamic executable (ie PIC code).  Drew's test was measuring
the startup overhead.

>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.

You have measured different things.  Drew's test shows that a dynamic
/bin/sh tahes about 40% longer to start.  Your test shows that once
started, it runs about 11% slower.  And the 11% slower is _very_
worrying since it is probably more widely applicable than just /bin/sh.

Peter
Received on Mon Nov 24 2003 - 23:02:18 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:30 UTC