Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Decrease waiting time in a Laravel application

I'm developing a PHP application written using the Laravel 4.1 framework. So far I only have a few MySQL queries per page, many of them are cached using the Cache class where possible, using a Redis server.

Currently I'm developing locally with an internal (but not localhost) MySQL database, using Apache 2.2.24 and PHP 5.4.17.

Using Chromes Developer Tools, I'm checking the Network tab to see how long the page is taking to load etc, but I'm seeing some weird results. The page spends a long time waiting for the content to be served, as you can see below:

Network output

As you can see, the new page takes 682ms waiting for the content to be sent back to the browser. Is there anyway that I can improve this? Why does Laravel has such a big overhead?

Apart from a custom Facade that we use to make using Entypo easier, there are no extra packages except the defaults that come with Laravel.

Does anybody know how this can be improved?

like image 431
James Avatar asked Feb 20 '14 09:02

James


1 Answers

If I were you I would install the Chrome Clockwork extension plus the Laravel Clockwork package from Composer. Clockwork gives you a timeline where you can see what it is that takes so long, plus a database query tab where you can see how long time each query takes to load.

screenshot of clockwork

Happy hunting (:

like image 193
jah Avatar answered Sep 30 '22 13:09

jah