Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92088 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28203 invoked from network); 5 Apr 2016 08:47:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Apr 2016 08:47:44 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.169 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.214.169 mail-ob0-f169.google.com Received: from [209.85.214.169] ([209.85.214.169:36207] helo=mail-ob0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 93/00-27948-EAB73075 for ; Tue, 05 Apr 2016 04:47:42 -0400 Received: by mail-ob0-f169.google.com with SMTP id j9so4868296obd.3 for ; Tue, 05 Apr 2016 01:47:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=4AfanGOMdFTuEOILpHmlaCsI3JczKwvNDL5wiBiayQ4=; b=oSC+4wMyKYVfsGNDrM4DlZrb8I6Hq5xDmgO0dYohjZTnD9EyAaE1pxAQWTmOSLIjQ/ NycJfbfVQc7N8n3BGmdD255xiL3LMNFakK6OTgbqCbKbOgxRDwhm/Ddg99hfDyAPosTg t5oxxv/L9zgHf6txiSmx9MB+A6yqCLe6N3WIjhAH5grQyEtGTs3F/C15rxGQfbIdmyG+ u8B5MXx0ME4rJPx2fp8FovrynJvwkxXvjhIu1vBfskNXGbVmBDIij3YVaQ2ILYgmE4GN jm0nktKgw0ATHNW2Hb56a/MVIokiLM0lif9OBoPiPD0xp/OLGVmdeR5qNDbqmzcrU9Zr Q6cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=4AfanGOMdFTuEOILpHmlaCsI3JczKwvNDL5wiBiayQ4=; b=ZXhKTMtZvEmpvaqqqSq8/K249NxjxJ4nx95efkr0nLWxomYwqBAgTJ+sutcyWtrH8D BtmK4XMs4b8QE6QLaXaeqU33UNZS3DAwB2SYfjqGedCWe8n6xuu7OuPdZqoxTmr0AjvI dOBK1VizLmikmBPQYyse7hGtSte62aHxTy7ZOtbRT9WETNyZpG6IVPfUEd/cvJ3y4jF7 qDuYpwtTa+aOgjiyyn+f4ImW3hGC/zLV/9bHw8AT4/18t2PQDzfIKjHKhijqh8aVvqHc dhuhkywPZWX40apPZZ4CtHnPij5fkCncJQezDalv3Fj9QUxZkuZN3tzUDlzUZLz/qf4X GTDA== X-Gm-Message-State: AD7BkJL4Sh+ltrKofcJLjpBR4rw/qyySxjmAChdBzqQLLN3McuHC8lvxB6o4aGG/NItvFROCSfgAZXznZ2/Svw== MIME-Version: 1.0 X-Received: by 10.60.159.105 with SMTP id xb9mr13292925oeb.26.1459846060060; Tue, 05 Apr 2016 01:47:40 -0700 (PDT) Received: by 10.202.215.193 with HTTP; Tue, 5 Apr 2016 01:47:40 -0700 (PDT) In-Reply-To: References: Date: Tue, 5 Apr 2016 15:47:40 +0700 Message-ID: To: Dmitry Stogov Cc: Nikita Popov , Bob Weinand , Xinchen Hui , Eran Ifrah , internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] RETURN micro optimization From: pierre.php@gmail.com (Pierre Joye) On Tue, Apr 5, 2016 at 2:59 PM, Dmitry Stogov wrote: > Hi, > > > I propose a micro optimization for RETURN statement. > > Currently "return $x" increments reference counter of $x, then in zend_leave_helper() we perform zval_ptr_dtor() on the same $x. > > The patch sets the original value of $x to null in first place, so zval_ptr_dtor() is not going to be called. > > > https://gist.github.com/dstogov/36f68b206242a39691ac539c2fc85d40 > > > the performance impact is invisible (0.1% less instruction retired on Wordpress). > > > It breaks sapi/phpdbg/tests/breakpoints_005.phpt, but this is probably not a big deal. > > BTW: this change may affect debuggers in some other way. I suppose it is for 7.1 anyway, right? so debugger will have to be ported but it would be nice to know exactly how this change will affect them to make sure that users can migrate to 7.1 smoothly and still use their tools. Cheers, -- Pierre @pierrejoye | http://www.libgd.org