Looks like an interesting patch, if it does not cost us any performance and only offers either no gain or a small gain I'd say it would be worth inclusion. Perhaps branch prediction will work better with newer versions of gcc like 4.0 or 4.1

On 18-Jun-06, at 9:49 AM, 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



Ilia Alshanetsky

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

Reply via email to