Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:24152 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64097 invoked by uid 1010); 19 Jun 2006 08:06:36 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 64081 invoked from network); 19 Jun 2006 08:06:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jun 2006 08:06:36 -0000 X-PHP-List-Original-Sender: zeev@zend.com X-Host-Fingerprint: 80.74.107.235 mail.zend.com Linux 2.5 (sometimes 2.4) (4) Received: from ([80.74.107.235:51295] helo=mail.zend.com) by pb1.pair.com (ecelerity 2.1.1.3 r(11751M)) with ESMTP id 33/DC-25433-85656944 for ; Mon, 19 Jun 2006 03:46:34 -0400 Received: (qmail 8813 invoked from network); 19 Jun 2006 07:45:59 -0000 Received: from localhost (HELO zeev-notebook.zend.com) (127.0.0.1) by localhost with SMTP; 19 Jun 2006 07:45:59 -0000 Message-ID: <7.0.1.0.2.20060619104547.09bfc190@zend.com> X-Mailer: QUALCOMM Windows Eudora Version 7.0.1.0 Date: Mon, 19 Jun 2006 10:46:27 +0300 To: "Nuno Lopes" Cc: "PHPdev" In-Reply-To: <002901c692de$108b2fb0$0100a8c0@pc07653> References: <002901c692de$108b2fb0$0100a8c0@pc07653> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Re: [PHP-DEV] messing with branch prediction From: zeev@zend.com (Zeev Suraski) Definitely looks nice. I actually like how it makes the code more readable hinting which branches are rare. Zeev At 16:49 18/06/2006, Nuno Lopes wrote: >Hello, > >Yesterday I was playing with branch prediction in the Zend VM >executor. Although I didn't have any noticeable performance >improvement within the bench.php script, I've put the patch on-line, >because someone else might want to mess with it too :) (but with care..) > >patch: http://mega.ist.utl.pt/~ncpl/zend_branch_prediction.txt >gcc docs: >http://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#index-g_t_005f_005fbuiltin_005fexpect-2440 > >the zend.h part of the patch is based on the similar macros (with >the same name, too) found in the Linux kernel. > >I made & tested the patch in a Centrino laptop with gcc 3.4, so it >might be the cause of getting no relevant performance increase. On >CPUs with longer pipelines (like Pentium 4/NetBurst architecture), >the performance increase might be noticeable. > > >Happy hacking :) >Nuno >-- >PHP Internals - PHP Runtime Development Mailing List >To unsubscribe, visit: http://www.php.net/unsub.php