From owner-freebsd-performance@FreeBSD.ORG Fri Mar 11 11:51:20 2011 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0CE97106566B for ; Fri, 11 Mar 2011 11:51:20 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 92AB48FC18 for ; Fri, 11 Mar 2011 11:51:19 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p2BB6lJr040061 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 11 Mar 2011 13:06:47 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p2BB6l6E023880; Fri, 11 Mar 2011 13:06:47 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p2BB6lfA023879; Fri, 11 Mar 2011 13:06:47 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 11 Mar 2011 13:06:47 +0200 From: Kostik Belousov To: Martin Matuska Message-ID: <20110311110647.GN78089@deviant.kiev.zoral.com.ua> References: <4D7943B1.1030604@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7UNBg6+RNQqlggSk" Content-Disposition: inline In-Reply-To: <4D7943B1.1030604@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-performance@freebsd.org, freebsd-current@freebsd.org Subject: Re: FreeBSD Compiler Benchmark: gcc-base vs. gcc-ports vs. clang X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Mar 2011 11:51:20 -0000 --7UNBg6+RNQqlggSk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 10, 2011 at 10:33:37PM +0100, Martin Matuska wrote: > Hi everyone, >=20 > we have performed a benchmark of the perl binary compiled with base gcc, > ports gcc and ports clang using the perlbench benchmark suite. > Our benchmark was performed solely on amd64 with 10 different processors > and we have tried different -march=3D flags to compare binary performance > of the same compiler with different flags. >=20 > Here is some statistics from the results: > - clang falls 10% behind the base gcc 4.2.1 (test average) > - gcc 4.5 from ports gives 5-10% better average performance than the > base gcc 4.2.1 > - 4% average penalty for Intel Atom and -march=3Dnocona (using gcc from b= ase) > - core i7 class processors run best with -march=3Dnocona (using gcc from = base) >=20 > This benchmark speaks only for perl, but it tests quite a lot of > "generic" features so we a are seriously considering using ports gcc for > heavily used ports (e.g. PHP, MySQL, PostgreSQL) and suggesting that an > user should be provided with a easily settable choice of using gcc 4.5 > for ports. >=20 > A first step in this direction is in this PR (allowing build-only > dependency on GCC): > http://www.freebsd.org/cgi/query-pr.cgi?pr=3Dports/155408 >=20 > More information, detailed test results and test configuration are at > our blog: > http://blog.vx.sk/archives/25-FreeBSD-Compiler-Benchmark-gcc-base-vs-gcc-= ports-vs-clang.html Putting the 'speed' question completely aside, I would like to comment on other issue(s) there. The switching of the ports to use the port-provided compiler (and binutils) would be very useful and often talked about feature. Your approach of USE_GCC_BUILD as implemented is probably not going to work. The problem is that gcc provides two libraries, libgcc and libstdc++, that are not forward-compatible with the same libraries from older compilers and our base. libstdc++ definitely did grown new symbols and new versions of old symbols, and I suspect that libgcc did the same. Also, we are trusting the ABI stability premise. For this scheme to work, we at least need a gcc-runtime port with dsos provided by full port, and some mechnanism to force the binaries compiled with port gcc to use gcc-runtime libs instead of base. Might be, -R linker cludge. --7UNBg6+RNQqlggSk Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk16AkcACgkQC3+MBN1Mb4iIRwCeIT06hU87Qh6XusOKxwZIcFn1 XaAAoKJYekOQhkw7GDStE8a5cqsLfsd3 =vWaL -----END PGP SIGNATURE----- --7UNBg6+RNQqlggSk--