Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93637 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97030 invoked from network); 30 May 2016 18:56:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 May 2016 18:56:01 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.172 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.161.172 mail-yw0-f172.google.com Received: from [209.85.161.172] ([209.85.161.172:36553] helo=mail-yw0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 68/C0-26200-0CC8C475 for ; Mon, 30 May 2016 14:56:01 -0400 Received: by mail-yw0-f172.google.com with SMTP id x189so168986963ywe.3 for ; Mon, 30 May 2016 11:56:00 -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=catrhZtMoxemCLO5Nu/Y/jaDNFfEeHLYTwdmqQLQNWM=; b=NwvTvUJUdT6skIxzONGqcut5LX+CjR1GzE8pEEldy2FedEhmO6TV7dHolJuGgK/OI0 p+tIVox0wssT/yb1nL3OpRSOS04geG8wW3aA78MCygP17FQJ3CgMTFHOO7nhLVHbWboi azio2DCxQ4n1LA26ZYglStbxJSuy98rAXghfv09NkoIQUK7xpLGOR/1BN+85pShW1WYk vaMeW6J0hxklFGq3Y7ZJyUVPOuScTswGkOB3kx1sGvD62TpxI6dS7vv2Ek2iLlj3GvD4 C8f8HwudvfMMnq8yf/v+uE7ojbtWIuUrH4p8sW/9GmmJeAFNGkymAwAfyrjdItTQ1Zl6 hezw== 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=catrhZtMoxemCLO5Nu/Y/jaDNFfEeHLYTwdmqQLQNWM=; b=QoxpTzBfFdKIT3OQwMYFQ7Xe2n51zPEkoBU4iso7BhjpAUsbes5n485Ah+6GhbdHJ1 lbkBcgZCB7wCbD75oY4tJ5SUfgec0qelZCxjHLiUXIr6Zhvurimub+bAjqDrsgVsU/KC OhuFUfGGE86QQBkbXW7eKOC8yaBbZXVQ6hNhwDerN0HVDgmvpU5YTY+GIpZC3HlW0d9W yEbcTxgIV1lhDwIANJ4feZQTSjqNzyFmP5VFoxqbKXKOKssE+Lc9en6s5p0NAZ2A6db1 gxO/s91QS7JTujLtRDVYPjucKWtD6/cyIJAH9xjS7Mp0WLB4hXT6aXw9qqcHlvrxMCLe VDUA== X-Gm-Message-State: ALyK8tIIN1eMc89FFeYoi/LUQ9/NulcajpYdf7ia60ernW/LM7bYZBB0hArwd+zsyl4KLyPkA/HdyH6/6I/sLA== MIME-Version: 1.0 X-Received: by 10.37.36.6 with SMTP id k6mr16847031ybk.45.1464634557883; Mon, 30 May 2016 11:55:57 -0700 (PDT) Received: by 10.13.239.3 with HTTP; Mon, 30 May 2016 11:55:57 -0700 (PDT) In-Reply-To: References: Date: Mon, 30 May 2016 20:55:57 +0200 Message-ID: To: "Colin O'Dell" Cc: Marco Pivetta , PHP Internals , Jeremy Mikola Content-Type: multipart/alternative; boundary=001a113ce0e08c6fe5053413ce27 Subject: Re: [PHP-DEV] [RFC Discussion] array_change_keys() From: nikita.ppv@gmail.com (Nikita Popov) --001a113ce0e08c6fe5053413ce27 Content-Type: text/plain; charset=UTF-8 On Mon, May 30, 2016 at 3:40 AM, Colin O'Dell wrote: > Marco, > > > > 1. could you also provide the code for the benchmarks? I'd gladly > measure > > them with an accurate tool > > > > Yeah that would be great! Here's the benchmark I was using: > https://gist.github.com/colinodell/872c1f0c92351af687347c0c8be4f253 I can't tell you what exactly this is benchmarking (probably a mix of various caches ranging from the Zend MM, via the kernel, to the CPU). The only thing it's pretty certainly not benchmarking are different implementations of changing keys :) You're basically just penalizing whichever implementation comes first. For a more representative benchmark, reduce the number of elements by a factor of 10 or hundred. In which case foreach should win at least against the array_map+array_combine implementation. Regards, Nikita --001a113ce0e08c6fe5053413ce27--