Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92092 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34623 invoked from network); 5 Apr 2016 09:15:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Apr 2016 09:15:09 -0000 Authentication-Results: pb1.pair.com header.from=pthreads@pthreads.org; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=pthreads@pthreads.org; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain pthreads.org from 209.85.161.172 cause and error) X-PHP-List-Original-Sender: pthreads@pthreads.org X-Host-Fingerprint: 209.85.161.172 mail-yw0-f172.google.com Received: from [209.85.161.172] ([209.85.161.172:33749] helo=mail-yw0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F5/61-27948-C1283075 for ; Tue, 05 Apr 2016 05:15:09 -0400 Received: by mail-yw0-f172.google.com with SMTP id t10so9120655ywa.0 for ; Tue, 05 Apr 2016 02:15:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pthreads-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=91k0rI/b0lRZdwbkgIg09HHrw2zcz9ZmN2mQIJQ0H+M=; b=nftg7vPwZtw/CV3kVGjqHgQfVVx0/g0kNd8FqfOo+Gc9zDnKMb468boQK9JEIxWcM7 B2Vjdcj7cppAaAyirhhzf2R3T0eTnnzp04UuTUs/DYRMrMUhnFenJQ6/zjNOWxWDsL3/ GxoQqC7kPSbKYHV46bxrSJ0EItx30HRmrHeok1q/vbJduiGJRMSDbkzF1IYyEDw04cGE xV12z2GJVrfCJLSoz+q755S5MDcb6+MI5erJSsZv75UUybAzWgQrb4fSVnS110uZ0KpD HgGdfSxB9veRjgqy2AB0GdRZy3gdogZXMa9H4+dQb+80cNEiXGA4Ay6BSIt+leZF+NyQ wCPw== 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=91k0rI/b0lRZdwbkgIg09HHrw2zcz9ZmN2mQIJQ0H+M=; b=I1whv3tvG+cEujG4jJUqfwPLXr2r7+33FYnxWNrDn5w2K2rIZvXtdFj2UNvGd931Ns R588nP+nquaO4Tvj+VaAT5A0yISjZJr/OCd5wcdMUNLSuPUPxsTRxewJuGcKcXZiCgL2 bYfW8Z4tpJ+atPw7NduxcTA0qYODzDktfqRuPan8fvVDpEA2IxbCvhtH7r1V863xaAwC 9nk6oxt8+edKoZYpZHGOrdtwiFk0O7qEhgbZRhpdgy3IiYzv3vgdcrMZRYYFwXCH2KLq KcNAHFkXCZ0wtNKLM445xId+CRyUwp7kt5ocHC2KH/s2nS7w5cE+HtQpmkSPGZkIvEG4 PAYQ== X-Gm-Message-State: AD7BkJIKOSVh2Fw5Zow2Bv/f0CN5UChDHhKiEZHF1EtBKyo2rDydyi9KqC3QwF92qdkzEuZzg5bwXi2Dc1BhOA== MIME-Version: 1.0 X-Received: by 10.37.30.86 with SMTP id e83mr20652567ybe.79.1459847706340; Tue, 05 Apr 2016 02:15:06 -0700 (PDT) Received: by 10.129.39.9 with HTTP; Tue, 5 Apr 2016 02:15:06 -0700 (PDT) X-Originating-IP: [109.159.6.57] In-Reply-To: References: Date: Tue, 5 Apr 2016 10:15:06 +0100 Message-ID: To: Derick Rethans Cc: Dmitry Stogov , Nikita Popov , Bob Weinand , Xinchen Hui , Eran Ifrah , internals Content-Type: multipart/alternative; boundary=001a1143f39af6caa0052fb947db Subject: Re: [PHP-DEV] RETURN micro optimization From: pthreads@pthreads.org (Joe Watkins) --001a1143f39af6caa0052fb947db Content-Type: text/plain; charset=UTF-8 Morning Derick, I don't think it does make anything impossible, it's just a more efficient copying method in the EXPECTED branch is all. Cheers Joe On Tue, Apr 5, 2016 at 10:04 AM, Derick Rethans wrote: > On Tue, 5 Apr 2016, Dmitry Stogov wrote: > > > 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'd like to know why this breaks before saying something. It'd be a PITA > if this micro optimisation wouldn't actually do a lot performance wise, > but makes some debugging not possible. > > cheers, > Derick > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --001a1143f39af6caa0052fb947db--