Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81472 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92113 invoked from network); 31 Jan 2015 08:18:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Jan 2015 08:18:17 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain lerdorf.com designates 209.85.216.180 as permitted sender) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.216.180 mail-qc0-f180.google.com Received: from [209.85.216.180] ([209.85.216.180:48473] helo=mail-qc0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FA/50-24235-7CF8CC45 for ; Sat, 31 Jan 2015 03:18:15 -0500 Received: by mail-qc0-f180.google.com with SMTP id r5so23881874qcx.11 for ; Sat, 31 Jan 2015 00:18:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type; bh=xwwU40mdiU6HXs73u8lvlUV06tvafrReEbUlR/TmioQ=; b=Dw3cBw5XpUHs6AHDHKUFT6P9Yc6AnnLPTKVoNtOnPrSCq42GDnXZLGv2wtx/1f5IxM 0vZN6plwIZIbzGAKpJnKGg7e3lugmIAyHfj0ZkrHKtY6/rmnuEjEClooeyceh0spDCXC PS1RMh3CKnx5kQuu+5RAC9nM/hOKX3KHmCk22IIx9EYBfLgTVdJBXwAFyBbXNud9a6eC FP/8XXkJVT1zNHAYrXLnZcPjF+IvOMhj/Gj81LCkvUj1ERIMenhtPGNkwXAH968f4wnP PDjm0BnNz1xM1rZ8etJVJspI4gDSQ9REMaJvxKX4qR7309Q6X6BtbD0Gxob6lAcmbq46 AVaw== X-Gm-Message-State: ALoCoQk6KoWXsYgfUASW20PpZJHaitL+iw7fSG4PF8ap5DJ94/eoMnvGIz4U/nntgklvQQCAjPDn X-Received: by 10.224.28.198 with SMTP id n6mr20586650qac.15.1422692292817; Sat, 31 Jan 2015 00:18:12 -0800 (PST) Received: from [192.168.200.14] (c-50-131-44-225.hsd1.ca.comcast.net. [50.131.44.225]) by mx.google.com with ESMTPSA id q10sm11187855qaq.9.2015.01.31.00.18.11 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 31 Jan 2015 00:18:11 -0800 (PST) Message-ID: <54CC8FC2.10704@lerdorf.com> Date: Sat, 31 Jan 2015 00:18:10 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Dmitry Stogov , PHP Internals CC: Nikita Popov References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tb0Gx3biMGKJcMvMHow5ERoixDgjL5umI" Subject: Re: [PHP-DEV] [RFC] Fix "foreach" behavior From: rasmus@lerdorf.com (Rasmus Lerdorf) --tb0Gx3biMGKJcMvMHow5ERoixDgjL5umI Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/30/2015 09:10 PM, Dmitry Stogov wrote: > Hi, >=20 > Nikita got an idea about stopping changing of array/object internal > pointers even in forech by reference. > I've added an additional RFC section: >=20 > https://wiki.php.net/rfc/php7_foreach#additional_behavoir_change >=20 > Trivial implementation on top of the main patch: >=20 > https://gist.github.com/dstogov/63b269207ba0aed8b776 >=20 > and an additional proposed voting question. >=20 > 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 --tb0Gx3biMGKJcMvMHow5ERoixDgjL5umI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlTMj8IACgkQlxayKTuqOuAf0QCeP++g/ako2rkieHPOhnL12KuJ 0WQAnjzHaAIVQvjzcECTZiaNLS9Dmv+3 =RDrs -----END PGP SIGNATURE----- --tb0Gx3biMGKJcMvMHow5ERoixDgjL5umI--