Question

i installed fresh copy of laravel4 , than installed Laravel 4 starter kit site:

laravelcp

My site run so slow between pages(loads):

enter image description here

969ms , and i have 950-1.5ms this very bad.

I using localhost wamp.

What i tryed:

  1. optimize wamp.
  2. i changed from localhost to 127.0.0.1 at database.php
  3. i did both php artisan optimize and php artisan optimize --force

Also when i install fresh copy of laravel i have 130-160ms.

When i install other starter kit i have 320-400ms.

Anyway i am laravel 4 newbie , how can i check what makes the load time ?

maybe its some package or something.

Was it helpful?

Solution

If you have debug=true in app/config/app.php (or a local environment's config) you will not be cacheing anything. If you aren't using the cache then it makes sense that your load times with apc vs file cacheing would be similar.

First, try setting debug to false globally, or for your local environment. Then run php artisan optimize after cacheing is disabled.

Test your speeds using a direct route (no controller, simply return "some string"; from the routes.php route for the homepage.

Try returning the same string from a controller action. Map this action to the same route for the homepage and compare. On my local setup I see about a 10ms difference.

If that doesn't speed your app up then try installing the profiler suggested (or the one I prefer: https://packagist.org/packages/sebklaus/profiler) and see what is taking the most time to run. You can enable either profiler so that they run even when debug mode is false.

Another alternative is not to worry about local speed or speed during development and get laravel sped up once your app is working as you want.

Here are some tips to help you with the post-development optimization: Optimizing for production with Laravel 4

OTHER TIPS

For simple debugging, there's a cool debugbar you can install and profile your app with:

https://github.com/barryvdh/laravel-debugbar

It'll show you how long laravel takes to boot up and gives you some other debugging and profiling options.

Also, it looks like you tried running 'php artisan optimize'. Just in case you didn't try it yet, make sure to turn off debug mode before optimizing. This will turn off lots of debugging features, but it will drastically reduce the amount of files Laravel needs to include.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top