Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).
Version | System time (s) | User time (s) | Memory (MiB) |
---|---|---|---|
8.1.24 | 0.014 | 0.269 | 19.50 |
<?php
$items = [
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'],
];
$iterations = 1000;
$start = microtime(true);
for ($i=0 ; $i<$iterations ; $i++) {
$reduced = array_reduce($items, fn($carry, $scope_items) => [...$carry, ...array_values($scope_items)], []);
}
$split = microtime(true);
for ($i=0 ; $i<$iterations ; $i++) {
$item_sets = [];
foreach ($items as $scope_items) {
$item_sets[] = array_values($scope_items);
}
$looped = array_merge(...$item_sets);
}
$end = microtime(TRUE);
echo "Reduce: " . ($split-$start)/$iterations . " sec\n";
echo "Merge: " . ($end-$split)/$iterations . " sec\n";
Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).
Version | System time (s) | User time (s) | Memory (MiB) |
---|---|---|---|
8.1.24 | 0.014 | 0.269 | 19.50 |