From owner-freebsd-current@FreeBSD.ORG Thu May 3 09:18:16 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6AFC9106566B; Thu, 3 May 2012 09:18:16 +0000 (UTC) (envelope-from erik@cederstrand.dk) Received: from csmtp2.one.com (csmtp2.one.com [91.198.169.22]) by mx1.freebsd.org (Postfix) with ESMTP id 2A3398FC18; Thu, 3 May 2012 09:18:16 +0000 (UTC) Received: from [192.168.1.15] (unknown [217.157.7.221]) by csmtp2.one.com (Postfix) with ESMTPA id 775AB303D838; Thu, 3 May 2012 09:18:15 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=iso-8859-1 From: Erik Cederstrand In-Reply-To: <201205020756.47783.jhb@freebsd.org> Date: Thu, 3 May 2012 11:18:15 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <5140DD3A-63A1-42B0-A464-317E54C4185F@cederstrand.dk> References: <20120426093548.GR2358@deviant.kiev.zoral.com.ua> <20120501135530.GA50127@in-addr.com> <13119BE4-531E-4681-89F0-876DC272B18F@cederstrand.dk> <201205020756.47783.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1257) Cc: Gary Palmer , freebsd-current@freebsd.org Subject: Re: [RFC] Un-staticise the toolchain X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Thu, 03 May 2012 09:18:16 -0000 Den 02/05/2012 kl. 13.56 skrev John Baldwin: >>=20 >> Static version: >> * 0.09 ms spent execve'ing /usr/bin/make >> * The rest is mostly sysctl calls >>=20 >> Dynamic version: >> * 0.09 ms spent execve'ing ./dynamicmake and /libexec/ld-elf.so.1 >> * 0.18 ms spent loading libc.so.7 (incl. reading /etc/libmap.conf and = /var/run/ld-elf.so.hints) >> * 0.11 ms spent calling sysarch(0x81,0x7fffffffXXXX) (static version = also does this but only uses 0.01 ms. No idea why) >> * The rest is mostly sysctl and sigprocmask calls >=20 > Keep in mind that the first time each system call is invoked, the = runtime > linker has to resolve the symbol. You can force the linker to do all > that when the object is loaded instead by setting LD_BIND_NOW=3Dyes in = the > environment of dynamicmake. If that makes the sysarch() call take = 0.01 > ms, then you know that the extra 0.10 ms is because of rtld doing the > lookup of sysarch() on the first sysarch() call. Thanks for the suggestion. There is only a single sysarch() call in each = version so I'm not sure that would help. Anyway, setting LD_BIND_NOW in = the dynamic case just made the sysarch() call 0.20 ms slower without = speeding up anything else. Kind regards, Erik=