Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68779 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67911 invoked from network); 31 Aug 2013 15:20:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Aug 2013 15:20:36 -0000 Authentication-Results: pb1.pair.com header.from=ellison.terry@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ellison.terry@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.170 as permitted sender) X-PHP-List-Original-Sender: ellison.terry@gmail.com X-Host-Fingerprint: 74.125.82.170 mail-we0-f170.google.com Received: from [74.125.82.170] ([74.125.82.170:58015] helo=mail-we0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AC/81-55332-3C902225 for ; Sat, 31 Aug 2013 11:20:36 -0400 Received: by mail-we0-f170.google.com with SMTP id w60so2651564wes.1 for ; Sat, 31 Aug 2013 08:20:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=7XycA9q7+LcKYUZBK6ZkHMWd2AK+8jxMhDvh9bZfcBA=; b=L/3yTcGhJCvtvWxY22xgrfqRXIdyjZe/EfEcC3P2/knrrycI/Twadi5TioPjCJZW6r jJSsg/eM4HjvYQtt7GnRe2cN/6I5X72+JSWXm+XjAVzerf8HULVGCF10KEnaermrl7ld C+P2TejQKjrBUq7qNzKNf9B+S9VDgWXn4Z9bTNM41g5AhSuOqfFCbUo/wdOcLVzVhXnn QQF1OXglhy8rxpyEJq5IYzl6Js20KuHbbG/gSJUr6qbffU5GNQv6dOeateO7W/QoMSQM bsoRKUT+ViyKSJ7FkAmf44tVGrhc12dKJc7pEdUaBYQKM+ZPmtdd28HjC+JUxtLWL5AR h7Hg== X-Received: by 10.194.178.166 with SMTP id cz6mr29127wjc.53.1377962432066; Sat, 31 Aug 2013 08:20:32 -0700 (PDT) Received: from [192.168.1.66] (host81-129-189-210.range81-129.btcentralplus.com. [81.129.189.210]) by mx.google.com with ESMTPSA id b13sm5022191wic.9.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 31 Aug 2013 08:20:31 -0700 (PDT) Message-ID: <522209BE.9070405@gmail.com> Date: Sat, 31 Aug 2013 16:20:30 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130803 Thunderbird/17.0.8 MIME-Version: 1.0 To: Nikita Popov CC: PHP internals References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: Always set return_value_ptr? From: ellison.terry@gmail.com (Terry Ellison) 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