Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:24149 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88512 invoked by uid 1010); 18 Jun 2006 13:49:52 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 88497 invoked from network); 18 Jun 2006 13:49:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jun 2006 13:49:52 -0000 X-PHP-List-Original-Sender: nlopess@php.net X-Host-Fingerprint: 212.55.154.24 relay4.ptmail.sapo.pt Linux 2.4/2.6 Received: from ([212.55.154.24:54904] helo=sapo.pt) by pb1.pair.com (ecelerity 2.1.1.3 r(11751M)) with ESMTP id 90/14-25433-BF955944 for ; Sun, 18 Jun 2006 09:49:50 -0400 Received: (qmail 3385 invoked from network); 18 Jun 2006 13:49:50 -0000 Received: from unknown (HELO sapo.pt) (10.134.35.152) by relay4 with SMTP; 18 Jun 2006 13:49:50 -0000 Received: (qmail 2863 invoked from network); 18 Jun 2006 13:49:50 -0000 X-AntiVirus: PTMail-AV 0.3-0.88.2 X-Virus-Status: Clean (0.00498 seconds) Received: from unknown (HELO pc07653) (nunoplopes@sapo.pt@[82.155.74.236]) (envelope-sender ) by mta2 (qmail-ldap-1.03) with SMTP for ; 18 Jun 2006 13:49:50 -0000 Message-ID: <002901c692de$108b2fb0$0100a8c0@pc07653> To: "PHPdev" Cc: , Date: Sun, 18 Jun 2006 14:49:47 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="Windows-1252"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2869 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 Subject: messing with branch prediction From: nlopess@php.net ("Nuno Lopes") 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