Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81517 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32285 invoked from network); 1 Feb 2015 03:32:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Feb 2015 03:32:36 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.220.175 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.175 mail-vc0-f175.google.com Received: from [209.85.220.175] ([209.85.220.175:39714] helo=mail-vc0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 09/5D-01632-35E9DC45 for ; Sat, 31 Jan 2015 22:32:35 -0500 Received: by mail-vc0-f175.google.com with SMTP id la4so13064143vcb.6 for ; Sat, 31 Jan 2015 19:32:32 -0800 (PST) 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:content-type; bh=ceRH3MieVDXirUjBnoJxYTHmQasZlSOPCsytcMuvFmM=; b=fwsaXVLwZMOXQqbfNfV4SpwbmibXkyI1xLmYDCmX454rr5ZHC3p4lu0LVQVFg+wro+ Kfq0fRx8FI+8uXHKNHOFKqDFhDFdT4XCFF1u9mDw+GwlmFHzdUYFmtzahaqmcodVilhR pLbw6RppzTw76E+HueUD+xk2x1mkiotY4EzM+1q+LE41zsCTYe65x/zHOsw0UpfpC9UK 7hpIUdK3zcPeXruI0tp6deTeEuSnb7e+K+rukFKuawH090FDqlh0Nb66HlYQCuVtDLFG KvIjNOogipkc5B9bZYJukDqp6RuOtn60tRjtl7IMEKeKtV+TiY0kBbbh8/IFQfBBLREU R+JQ== X-Gm-Message-State: ALoCoQlNVl2XM3UaxoQ37kcQysf5DlKdJuJd/ylN7awAkezPOi2Pb1ILKOr7AydTXIa3A/mzhJ5/AUpHDL3hq+PAOY2EEzq+4rsFL8J3FR3wiB32tN6jogStGaZYvgdIWQ7sG/flsiAoewd+/cB0+EkgmRtA1zzFCQ== MIME-Version: 1.0 X-Received: by 10.221.18.136 with SMTP id qg8mr7775677vcb.27.1422761552669; Sat, 31 Jan 2015 19:32:32 -0800 (PST) Received: by 10.52.26.40 with HTTP; Sat, 31 Jan 2015 19:32:32 -0800 (PST) Received: by 10.52.26.40 with HTTP; Sat, 31 Jan 2015 19:32:32 -0800 (PST) In-Reply-To: <54CC8FC2.10704@lerdorf.com> References: <54CC8FC2.10704@lerdorf.com> Date: Sun, 1 Feb 2015 07:32:32 +0400 Message-ID: To: Rasmus Lerdorf Cc: PHP Internals , Nikita Popov Content-Type: multipart/alternative; boundary=001a113399e6f285ae050dfe7c00 Subject: Re: [PHP-DEV] [RFC] Fix "foreach" behavior From: dmitry@zend.com (Dmitry Stogov) --001a113399e6f285ae050dfe7c00 Content-Type: text/plain; charset=UTF-8 Thanks for benchmarks. This time I didn't see so good results myself :) I actually, started this work with performance in mind, but after understanding all existing incosistencies, think that consistency is more important. Thanks. Dmitry. On Jan 31, 2015 11:18 AM, "Rasmus Lerdorf" wrote: > On 01/30/2015 09:10 PM, Dmitry Stogov wrote: > > Hi, > > > > Nikita got an idea about stopping changing of array/object internal > > pointers even in forech by reference. > > I've added an additional RFC section: > > > > https://wiki.php.net/rfc/php7_foreach#additional_behavoir_change > > > > Trivial implementation on top of the main patch: > > > > https://gist.github.com/dstogov/63b269207ba0aed8b776 > > > > and an additional proposed voting question. > > > > Also, the implementation now must be almost complete. > > I built your branch and applied Nikita's patch as well and ran it > through my benchmark box here. Before -> After numbers in requests/sec: > > Drupal8-b4 182 -> 184 > Wordpress-4.1 661 -> 675 > phpbb-3.1.2 1071 -> 1084 > Mediawiki-1.24.1 304 -> 306 > Opencart-2.0.1.1 458 -> 459 > WardrobeCMS-1.2.0 993 -> 999 > Geeklog-2.1.0 823 -> 825 > Traq-3.5.2 1869 -> 1902 > > So about a 1% boost across the board except for Opencart, but it spends > most of its time creating sessions on disk and writing to MySQL. > > No obvious visible things broke in any of these. Overall, even without > the performance boost, I think making the edge-case foreach behaviour > consistent and predictable is a good thing on its own. > > -Rasmus > > --001a113399e6f285ae050dfe7c00--