Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13160 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83717 invoked by uid 1010); 4 Oct 2004 23:59:33 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 83612 invoked from network); 4 Oct 2004 23:59:32 -0000 Received: from unknown (HELO mail.zend.com) (80.74.107.235) by pb1.pair.com with SMTP; 4 Oct 2004 23:59:32 -0000 Received: (qmail 15809 invoked from network); 4 Oct 2004 23:59:30 -0000 Received: from localhost (HELO AndiNotebook.zend.com) (127.0.0.1) by localhost with SMTP; 4 Oct 2004 23:59:30 -0000 Message-ID: <5.1.0.14.2.20041004165825.0511e990@localhost> X-Sender: andi@localhost X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Mon, 04 Oct 2004 16:59:28 -0700 To: Sebastian Bergmann ,internals@lists.php.net In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Re: [PHP-DEV] GCC/CFLAGS Benchmark for HEAD and PHP_5_0 From: andi@zend.com (Andi Gutmans) References: I've done lots of testing with these kind of compiler flags. It's really a tough call because you might change 2 lines in the PHP code and then your results might differ completely because of CPU cache hits/misses. Also very much depends on the CPU. But in any case, interesting results. Andi At 08:30 PM 10/4/2004 +0200, Sebastian Bergmann wrote: > 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 > >-- >PHP Internals - PHP Runtime Development Mailing List >To unsubscribe, visit: http://www.php.net/unsub.php