0

The app is not even big,but it takes over 5 seconds to reload some pages,i don't think that is normal eventhough I read that laravel is pretty slow,but this is unusable,I've installed debugbar and it is showing that booting takes over 3.5 seconds while loading of the app is over 2.5 seconds,I've been following a course and instructor's app loads instantly,can someone tell me what effects the booting and load time?

Chain Truth
  • 141
  • 3
  • 10
  • Hi, first of all, share what you see on the DebugBar, I cannot help you if you say "I have a Ferrari, but when I floor it, RPM goes from 1000 to 5000 in 10 seconds..." if you don't share what you already have, what you are seeing (as debug data), and in this case what hardware you have or your app is running on, is like asking why do you have a health problem without knowing what you do in your life to maybe have it... – matiaslauriti Nov 21 '20 at 22:57

2 Answers2

1

Since this is a general question without specific detail here's a general answer:

Your first step should be to install the Laravel debug bar (which you say you have) and then look at the query time or controller time and narrow down the culprit. Based on that, you can ask more pointed questions on StackOverflow with the details of the specific queries that are slow, or if it's a controller that's slow, you can post the contents of that controller file. From there we can make recommendations in terms of what changes you can make.

One other thing to try is on the same machine try out a vanilla Laravel app and see what the baseline load times are. Maybe there's nothing wrong with your app at all and instead it has something to do with whatever is serving it.

Citizen
  • 12,430
  • 26
  • 76
  • 117
  • Here are the screenshots that i took: Home page app request - http://prntscr.com/vnp4rf (Query takes around 4 ms) , Register page app request - http://prntscr.com/vnp5kp ( Part of UI package) , Registering a user request http://prntscr.com/vnp6dc and then I tried the vanilla app,home page still loads pretty slowly,around 3 seconds - http://prntscr.com/vnp7v4 and I've create a new view with only one h1 and it still takes 2.3 seconds to load - http://prntscr.com/vnp8ub ,so all across the board there is a huge waiting time for css files to load and page to download eventhough it is 40 kb – Chain Truth Nov 22 '20 at 07:43
1

Alright,I think I've got it fixed,was using XDebug for PHP lectures for collage and that is why app was running so slowly,so I've disabled it.

If anyone else will have similar problem here is the solution,but be aware that this will disable your xDebug:

Open XAMMP -> Click on config button for Apache -> Open PHP (php.ini). Inside of that file look for "[xDebug]" and comment out all the commands that enable it ( in front of commands put ";" and space (" ") ) . It should look like this:

; [xDebug]
; zend_extension = C:\xampp\php\ext\php_xdebug-2.9.8-7.2-vc15-x86_64.dll
; xdebug.remote_enable = 1
; xdebug.remote_autostart=on

And then restart the server

If you need xDebug,then check out this post - PHP on Windows with XAMPP running 100 times too slow

Chain Truth
  • 141
  • 3
  • 10