From owner-svn-src-head@freebsd.org Sat Oct 26 14:34:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0D293175539; Sat, 26 Oct 2019 14:34:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 470k596cWVz4GLY; Sat, 26 Oct 2019 14:34:21 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:470:7a58:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id 9C7B31EF02; Sat, 26 Oct 2019 14:34:21 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:470:7a58::80c4:747d:baa2:7d92] (unknown [IPv6:2001:470:7a58:0:80c4:747d:baa2:7d92]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 323B44D1B4; Sat, 26 Oct 2019 16:34:20 +0200 (CEST) From: Dimitry Andric Message-Id: <67F6BDD3-B633-4C85-AE85-9B075FF0E49E@FreeBSD.org> Content-Type: multipart/signed; boundary="Apple-Mail=_48607C31-39D2-4632-979A-EBE534FAA450"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r353937 - in head/share: man/man5 mk Date: Sat, 26 Oct 2019 16:34:14 +0200 In-Reply-To: <20191024124910.GA93913@FreeBSD.org> Cc: Enji Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Alexey Dokuchaev References: <201910231702.x9NH2jQv045130@repo.freebsd.org> <2B855247-5097-442D-8D4A-77D68D2F6186@gmail.com> <20191024124910.GA93913@FreeBSD.org> X-Mailer: Apple Mail (2.3445.104.11) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2019 14:34:22 -0000 --Apple-Mail=_48607C31-39D2-4632-979A-EBE534FAA450 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > On 24 Oct 2019, at 14:49, Alexey Dokuchaev wrote: > > On Wed, Oct 23, 2019 at 11:31:41AM -0700, Enji Cooper wrote: >>> On Oct 23, 2019, at 10:02, Dimitry Andric wrote: >>> New Revision: 353937 >>> URL: https://svnweb.freebsd.org/changeset/base/353937 >>> >>> Log: >>> Build toolchain components as dynamically linked executables by default > > What are the benefits of the new order? The advantages and disadvantages of dynamic linking are a contentious and almost religious issue, so I hope you don't mind that I will not go into this. >>> In this day and age, we have boot environments, virtual machine >>> snapshots, cloud backups, and other much more reliable methods to >>> restore systems to working order. So I think the time is ripe to flip > > What about those of us who cannot use BEs, VMs, and other "cloudy" tech > because, well, they might not work as well and reliably as one might think? There are many possibilities, such as making backups, using WITHOUT_SHARED_TOOLCHAIN (and hoping that you can compile/link your way out of a botched installation), or even using NO_SHARED. >> Using dynamic binaries instead of static binaries might actually regress >> performance in a way you don't expect, depending on -j values, etc. Static >> binaries avoid the dynamic linker, which (obviously) results in a perf hit >> at scale [...] > > Very good point. But if you take this point to its logical conclusion, then you should link everything statically, and never use dynamic linking at all. :) >> Did you calculate the perf trade offs for the static binaries at low -j vs >> high -j, system and user time, etc? > > I'd like to know the answer to this question (and the results) as well. I only tested -j24 on a 32-core system, but I could probably repeat the experiment with lower and higher -j values: * host system (and dynamic linker): head r346082 (2019-04-10) * base/head checkout at r354065 * clang and lld compiled from r354065, dynamically linked: text data bss dec hex filename 69007497 52320 290469 69350286 0x422338e bin-dynamic/cc 45708182 35280 320613 46064075 0x2bee1cb bin-dynamic/ld * clang and lld compiled from r354065, statically linked: text data bss dec hex filename 70828318 71656 2592977 73492951 0x46169d7 bin-static/cc 47533406 54776 2623121 50211303 0x2fe29e7 bin-static/ld * built world with __MAKE_CONF and SRCCONF set to /dev/null, and CC, CXX, CPP and LD set to point to either the dynamic or static binaries * verified that the cross-tools stage did /not/ attempt to bootstrap the compiler and linker * repeated experiment 7 times, for each case * measured real, user and system time of each experiment Results for real time: --------------------------------------------------------------------------- x static-real.txt + dynamic-real.txt N Min Max Median Avg Stddev x 7 1851.71 1892.11 1868.79 1868.6829 13.569253 + 7 1882.95 1940.74 1912.9 1912.6886 17.510156 Difference at 95.0% confidence 44.0057 +/- 18.2444 2.35491% +/- 0.985013% (Student's t, pooled s = 15.6641) Results for user time: --------------------------------------------------------------------------- x static-user.txt + dynamic-user.txt N Min Max Median Avg Stddev x 7 31734.75 32055.47 31983.16 31942.131 118.2333 + 7 32957 33282.1 33224.25 33150.727 137.84805 Difference at 95.0% confidence 1208.6 +/- 149.569 3.7837% +/- 0.47584% (Student's t, pooled s = 128.416) Results for user time: --------------------------------------------------------------------------- x static-sys.txt + dynamic-sys.txt N Min Max Median Avg Stddev x 7 2434.98 2661.22 2461.95 2516.3843 100.88134 + 7 2545.07 2813.8 2655.65 2682.5243 116.80319 Difference at 95.0% confidence 166.14 +/- 127.11 6.60233% +/- 5.1964% (Student's t, pooled s = 109.133) So ~2.3% difference in real time, which is not too bad I think. There are probably opportunities to improve the performance of the dynamic linker, which would be beneficial to every program in the system. -Dimitry --Apple-Mail=_48607C31-39D2-4632-979A-EBE534FAA450 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCXbRZZgAKCRCwXqMKLiCW o2BUAJ9ndlMld+F7K83SDJeJ3Y6G78mkKgCfYUfcFVxZsFLdl9uvFwvYmCRVuN8= =ER9l -----END PGP SIGNATURE----- --Apple-Mail=_48607C31-39D2-4632-979A-EBE534FAA450--