On 31/08/13 14:13, Nikita Popov wrote:
Is there any particular reason why we only pass return_value_ptr to internal 
functions if they have the ACC_RETURN_REFERENCE flag set?

Why can't we always provide the retval ptr, even for functions that don't 
return by reference? This would allow returning zvals without having to copy 
them first (what RETVAL_ZVAL does).

Motivation for this is the following SO question: 
http://stackoverflow.com/q/17844379/385378

Changes merged. Small benchmark to verify that this indeed avoids the copy: 
https://gist.github.com/nikic/6398090 :)

Nikita, IMO, this is a material performance optimisation of the PHP internals, as it removes one of the most common unnecessary (expensive) copies. So thanks for this.

It will be interesting to see the benefit on real apps such as MediaWiki. I'll pull a 5.5 snapshot and compare it to 5.5.2 :-)

Regards
Terry



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

Reply via email to