Hi,

I'm David Wang and I'm one of the students that is participating in Google 
Summer of Code for this summer. My project addresses detecting reference cycles 
in PHP, and I'm following this discussion because it seems very pertinent to 
what I will be working with this summer. I'm currently planning on implementing 
Bacon and Rajan's synchronous cycle collection algorithm based on reference 
counting. The algorithm requires performing a simple additional task for each 
increment or decrement of the reference counter. There is a branch in the 
decrement operation but there is no branch in the increment operation. I wasn't 
aware that a simple branch such as the one in the proposed patch would incur 
significant performance penalties on modern superscalar processors, since both 
execution paths would be followed simultaneously. However, I would also be very 
grateful for any performance data anyone can provide on this subject (and 
really, any other advice anyone has!).

The function call does strike me as completely unnecessary and the additional 
stack operations required are expensive. I'm willing to be that if the function 
was converted to a macro, the proposed solution would be a workable fix. Just 
my two cents; I'm not very experienced with the PHP internals yet.

Thanks all!

David Wang

-----Original Message-----
From: Stanislav Malyshev [mailto:[EMAIL PROTECTED] 
Sent: Sunday, May 20, 2007 11:08 PM
To: Cristian Rodriguez
Cc: internals@lists.php.net
Subject: Re: [PHP-DEV] Dismantling the lies...

> no, no performance tests has been done over that patch, but as rasmus
> said. it is probably negible or acceptable for real world.. I only
> knows it works with real like code ( i tried ezpublish, phpmyadmin)
> and passes the PHP test suite correctly ( or no worse than without the
> patch)

Well, php test suite is a functional test, so if the patch is done 
correctly it'd pass of course. I'm moe worried about the performance - 
my experience shows that the guesses are often wrong when talked about 
performance effects in complicated code. If you would have time to run a 
benchmark using something like bench.php and maybe some more complicated 
code, it'd be nice to know the result.
-- 
Stanislav Malyshev, Zend Products Engineer
[EMAIL PROTECTED]  http://www.zend.com/

-- 
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