[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-internals
Subject:    Re: [PHP-DEV] Re: Always set return_value_ptr?
From:       Terry Ellison <ellison.terry () gmail ! com>
Date:       2013-08-31 15:20:30
Message-ID: 522209BE.9070405 () gmail ! com
[Download RAW message or body]

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic