From owner-freebsd-current@FreeBSD.ORG Mon Nov 24 22:16:44 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DAF3516A4CE for ; Mon, 24 Nov 2003 22:16:44 -0800 (PST) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9029943FEA for ; Mon, 24 Nov 2003 22:16:43 -0800 (PST) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.9p2/8.12.9) with ESMTP id hAP6GUlg030848; Mon, 24 Nov 2003 23:16:30 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Mon, 24 Nov 2003 23:16:07 -0700 (MST) Message-Id: <20031124.231607.128865107.imp@bsdimp.com> To: sam@errno.com From: "M. Warner Losh" 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> X-Mailer: Mew version 2.1 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: freebsd-current@freebsd.org cc: gallatin@cs.duke.edu Subject: Re: 40% slowdown with dynamic /bin/sh X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Nov 2003 06:16:45 -0000 > 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