From owner-freebsd-current@FreeBSD.ORG Tue Nov 25 00:02:18 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 A1E9116A4CE for ; Tue, 25 Nov 2003 00:02:18 -0800 (PST) Received: from server.vk2pj.dyndns.org (c211-30-75-229.belrs2.nsw.optusnet.com.au [211.30.75.229]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0409243FE5 for ; Tue, 25 Nov 2003 00:02:15 -0800 (PST) (envelope-from peterjeremy@optushome.com.au) Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1])hAP81uJD077449; Tue, 25 Nov 2003 19:01:56 +1100 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.12.9p1/8.12.9/Submit) id hAP81tmS077448; Tue, 25 Nov 2003 19:01:55 +1100 (EST) (envelope-from peter) Date: Tue, 25 Nov 2003 19:01:55 +1100 From: Peter Jeremy To: "M. Warner Losh" Message-ID: <20031125080155.GC76478@server.vk2pj.dyndns.org> References: <20031124.191931.67791612.imp@bsdimp.com> <16322.50980.825349.898362@grasshopper.cs.duke.edu> <200311242125.13786.sam@errno.com> <20031124.231607.128865107.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031124.231607.128865107.imp@bsdimp.com> User-Agent: Mutt/1.4.1i 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 08:02:18 -0000 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