From owner-freebsd-current@FreeBSD.ORG Wed Nov 26 12:29:27 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 32CF716A4CE; Wed, 26 Nov 2003 12:29:27 -0800 (PST) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0760F43FBD; Wed, 26 Nov 2003 12:29:26 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) hAQKTOiF090551; Wed, 26 Nov 2003 12:29:24 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.9p2/8.12.9/Submit) id hAQKTNth090550; Wed, 26 Nov 2003 12:29:23 -0800 (PST) (envelope-from dillon) Date: Wed, 26 Nov 2003 12:29:23 -0800 (PST) From: Matthew Dillon Message-Id: <200311262029.hAQKTNth090550@apollo.backplane.com> To: Andrew Gallatin References: <16322.46449.554372.358751@grasshopper.cs.duke.edu> <20031124.190904.127666948.imp@bsdimp.com> <16322.47726.903593.393976@grasshopper.cs.duke.edu> <20031124.191931.67791612.imp@bsdimp.com> <16322.50980.825349.898362@grasshopper.cs.duke.edu> <16323.31748.84583.971494@grasshopper.cs.duke.edu> cc: "Jacques A. Vidrine" cc: freebsd-current@freebsd.org 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: Wed, 26 Nov 2003 20:29:27 -0000 : > That seems to have the most impact. We can also expend our efforts : > to improve dynamic linking performance, since that will improve the : > performance of the other 99.9% of the universe. : > : :What happened to mdodd's prebinding efforts? : :Drew Prebinding was put into DFly but the improvement is barely noticeable when you prebind /bin/sh. Prebinding is only really useful for much larger programs like mozilla which have thousands or tens of thousands of bindings. These numbers are on DragonFly and will be different on FBsd, but the relative numbers should be similar with a FBsd prebinding implementation. /bin/sh -------------- static freepg -16 zfod 12 dynamic freepg -46 zfod 34 dyn/prebind freepg -46 zfod 26 <<< saves 8*4=32KB worth of pre-zero'd pages but does not save any anon memory. 1000 runs of /bin/sh -c exit 0 (program to vfork/exec /bin/sh -c exit 0 1000 times). This effectively measures startup overhead only and is not inclusive of what a script might do in addition to starting up. /bin/sh static 11023 zfod's 00.54s dynamic 33023 zfod's 02.88s dyn/prebind 25023 zfod's 02.36s There isn't much of a time improvement but there is a significant improvement in the number of ZFOD's with prebinding. leaf:/usr/obj/usr/src/bin/sh# prebind /usr/obj/usr/src/bin/sh/sh object /usr/obj/usr/src/bin/sh/sh uniqid 986137809 object /usr/lib/libedit.so.3 uniqid -1757875926 object /usr/lib/libncurses.so.5 uniqid 1023436343 object /usr/lib/libc.so.4 uniqid 2011683737 Non-PLT Prebindings: object /usr/lib/libedit.so.3 count 5 object /usr/lib/libncurses.so.5 count 63 object /usr/lib/libc.so.4 count 203 PLT Prebindings: object /usr/obj/usr/src/bin/sh/sh count 106 object /usr/lib/libedit.so.3 count 63 object /usr/lib/libncurses.so.5 count 270 object /usr/lib/libc.so.4 count 638 Non-PLT COPY Prebindings: object /usr/obj/usr/src/bin/sh/sh count 13 -Matt Matthew Dillon