I think it's a nice idea but I doubt it's very useful at this point. It
doesn't seem to significantly affect performance, which is inline with some
tests that we have done in the past, where it's really the hardware
management of branch prediction and cache size which affect this. I doubt
that make such code changes will affect that in a significant way.
We are playing around with some memory management issues, and are relying on
some hardware branch predicition there (i.e. hoping that the hardware will
play nice with if() statements that always evaluate the same). It seems that
the hardware is playing pretty nice with us.
 

>-----Original Message-----
>From: Zeev Suraski [mailto:[EMAIL PROTECTED] 
>Sent: Monday, June 19, 2006 12:46 AM
>To: Nuno Lopes
>Cc: PHPdev
>Subject: Re: [PHP-DEV] messing with branch prediction
>
>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_00
>>5fbuiltin_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
>
>--
>PHP Internals - PHP Runtime Development Mailing List To 
>unsubscribe, visit: http://www.php.net/unsub.php
>

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to