Hey ! Did some tests , here is the results : Filter 50 categories
Bench::start('get_categories_cake'); $buff = new \Cake\Collection\Collection($all); for ($i = 0; $i < 10000; $i++) { $ladies = $buff->filter(function ($category, $key) { return $category['pk_i_id'] === '22'; }); $get_cake = $ladies->toArray(); } Bench::stop('get_categories_cake'); d($get_cake); Bench::start('get_categories_laravel'); $collection = new Illuminate\Support\Collection($all); for ($i = 0; $i < 10000; $i++) { $filtered = $collection->filter(function ($value, $key) { return $value['pk_i_id'] === '22'; }); $get_laravel = $filtered->all(); } Bench::stop('get_categories_laravel'); d($get_laravel);
Results :
[get_categories_cake] => Array ( [cpu_load] => Not enabled [duration] => 0.17000103 [memory] => 267.4 kb [peak] => 6.46 mb ) [get_categories_laravel] => Array ( [cpu_load] => Not enabled [duration] => 0.05999994 [memory] => 395.09 kb [peak] => 6.46 mb )
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey ! Did some tests , here is the results :
Filter 50 categories
Results :