Answer the question
In order to leave comments, you need to log in
Why is laravel so slow?
I have a PHP script that executes a database query 15,000 times.
The request takes only 1 second to complete.
As soon as I translate the same request to laravel
I get the result in 23 seconds.
Is there a way to optimize this query and why is laravel so slow?
$mysqli->query("Select * From `users`");
Users::All();
Answer the question
In order to leave comments, you need to log in
Because you are requesting a huge amount of data at a time, which is then wrapped into objects. You should not do this on any project, load data in portions https://laravel.com/docs/master/eloquent#chunking-...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question