Re: [RFC Discussion] array_change_keys()

From: Date: Mon, 30 May 2016 18:55:57 +0000
Subject: Re: [RFC Discussion] array_change_keys()
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-93637@lists.php.net to get a copy of this message
On Mon, May 30, 2016 at 3:40 AM, Colin O'Dell <colinodell@gmail.com> 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

« previous php.internals (#93637) next »