Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81473 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 94057 invoked from network); 31 Jan 2015 08:28:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Jan 2015 08:28:21 -0000 Authentication-Results: pb1.pair.com smtp.mail=xinchen.h@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=laruence@php.net; sender-id=unknown Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.215.52 as permitted sender) X-PHP-List-Original-Sender: xinchen.h@zend.com X-Host-Fingerprint: 209.85.215.52 mail-la0-f52.google.com Received: from [209.85.215.52] ([209.85.215.52:40486] helo=mail-la0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 77/B0-24235-0229CC45 for ; Sat, 31 Jan 2015 03:28:19 -0500 Received: by mail-la0-f52.google.com with SMTP id ge10so27794258lab.11 for ; Sat, 31 Jan 2015 00:28:14 -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:from:date :message-id:subject:to:cc:content-type; bh=fAHltvTdBXcCTqao67m5GfoWQXjP3nyPSjkLkuR04Ac=; b=U2EIimzWZanMbf97utTFC7Iqqd0RdiNsOEDmBTVo6vB6HUTsmKf3ATbD71a9rXo3s6 HTys/whSzHOu3E2PqAQgbnmvkO7KpztGRPgOyEuU/F2ffIhTWTX9Zvih14Yl/IJQc6jp oCkRT2D/DuDM/qoU/IOOjn2ROAcJ/S6KbZpD/U7LvtLmPM+IB+r2bt1fXP3/2NzlpwOv rk35O87XiHVFV7rDHsFjYtL2o6Tvr5w5dCPENtc1DQFOMPfwdeY7RHuujN0LFNvTqN1T zHkUI5bG1qjb6n/dbicar0vQFOpLGuA6YDN+QoBaWuvT8AN5P9OrzRsw8XrX5sJCVLmE ZhTA== X-Gm-Message-State: ALoCoQkR0cNbic/5JXu3E0PENTnwqnGNEnXUl+WQRa0Ir0pyKLc6kuY4CKN5T1C7y+PBS2kQYB9oC2U8M4YE/ccvFfEgob4wC7++PAqQWxBmeYfTybhoKm0AVhdaBiiXk8lg8+JK78ih6XfdXV+WNMD5qa5Xwmi6Kw== X-Received: by 10.112.150.98 with SMTP id uh2mr10276267lbb.92.1422692894117; Sat, 31 Jan 2015 00:28:14 -0800 (PST) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPSA id c1sm3187715lah.45.2015.01.31.00.28.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 31 Jan 2015 00:28:12 -0800 (PST) Received: by mail-la0-f46.google.com with SMTP id s18so27855854lam.5 for ; Sat, 31 Jan 2015 00:28:11 -0800 (PST) X-Received: by 10.112.167.228 with SMTP id zr4mr10306681lbb.20.1422692891889; Sat, 31 Jan 2015 00:28:11 -0800 (PST) MIME-Version: 1.0 Received: by 10.114.28.193 with HTTP; Sat, 31 Jan 2015 00:27:51 -0800 (PST) In-Reply-To: <54CC8FC2.10704@lerdorf.com> References: <54CC8FC2.10704@lerdorf.com> Date: Sat, 31 Jan 2015 16:27:51 +0800 Message-ID: To: Rasmus Lerdorf Cc: Dmitry Stogov , PHP Internals , Nikita Popov Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] Fix "foreach" behavior From: laruence@php.net (Xinchen Hui) On Sat, Jan 31, 2015 at 4:18 PM, 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. Nice~ thanks > > 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 > -- Xinchen Hui @Laruence http://www.laruence.com/