On Mon, May 30, 2016 at 3:40 AM, Colin O'Dell <colinod...@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