Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13146 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 39744 invoked by uid 1010); 4 Oct 2004 18:31:00 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 39693 invoked from network); 4 Oct 2004 18:30:59 -0000 Received: from unknown (HELO main.gmane.org) (80.91.229.2) by pb1.pair.com with SMTP; 4 Oct 2004 18:30:59 -0000 Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1CEXbv-0000cI-00 for ; Mon, 04 Oct 2004 20:30:59 +0200 Received: from p508e1f9f.dip.t-dialin.net ([80.142.31.159]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 04 Oct 2004 20:30:59 +0200 Received: from sb by p508e1f9f.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 04 Oct 2004 20:30:59 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: internals@lists.php.net Date: Mon, 04 Oct 2004 20:30:47 +0200 Lines: 66 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: p508e1f9f.dip.t-dialin.net User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en X-Enigmail-Version: 0.86.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Sender: news Subject: GCC/CFLAGS Benchmark for HEAD and PHP_5_0 From: sb@sebastian-bergmann.de (Sebastian Bergmann) I ran the Zend/bench.php script with PHP 5.0 and PHP 5.1 compiled with GCC 3.3 and GCC 3.4 using different optimizations on my Intel Pentium-M laptop: HEAD (PHP 5.1.0-dev) GCC 3.3.4 (-march=pentium3) -O0: 48.602 -Os: 29.920 -O1: 31.349 -O2: 29.029 -O3: 29.644 GCC 3.4.2 (-march=pentium-m -mtune=pentium-m) -O0: 48.966 -Os: 26.286 -O1: 29.253 -O2: 29.100 -O3: 27.767 -fprofile-{generate|use} -Os: 24.216 -fprofile-{generate|use} -O1: 26.575 -fprofile-{generate|use} -O2: 26.339 -fprofile-{generate|use} -O3: 25.537 PHP_5_0 (PHP 5.0.3-dev) GCC 3.3.4 (-march=pentium3) -O0: 58.394 -Os: 42.570 -O1: 43.454 -O2: 42.092 -O3: 42.066 GCC 3.4.2 (-march=pentium-m -mtune=pentium-m) -O0: 59.272 -Os: 35.853 -O1: 38.275 -O2: 37.989 -O3: 41.020 -fprofile-{generate|use} -Os: 33.926 -fprofile-{generate|use} -O1: 36.853 -fprofile-{generate|use} -O2: 35.335 -fprofile-{generate|use} -O3: 38.897 For the -fprofile-{generate|use} builds I used the Zend/bench.php script, too, to generate the profile information. If we were to add Makefile target (like GCC itself ("make profiled-bootstrap")) to the PHP build that makes use of -fprofile-{generate|use} it would make sense to use "make test" to generate the profiling information. When I find the time I will repeat the benchmark on my AMD Athlon64 box because I think the small L1/L2 caches of the laptop CPU affect the performance of the bigger code generated through optimizations. You can clearly see that code optimized for size (-Os) is faster than the more aggressive -O1, -O2, and -O3 optimization levels. -- Sebastian Bergmann http://www.sebastian-bergmann.de/ GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69