Hi,
I am new to laravel and started to develop my first project a few weeks ago. But the project is extremely slow – the page load is some 10 seconds (!) or more. It is still very basic, no db connection, just Vite and Tailwind.
Today I installed a brand new laravel project (composer create-project laravel/laravel example-app) to see how it performs without any additions like Tailwind or Vite, just a basic project. But the result is the same, page loads 10 or more seconds. Tried to access it both on localhost:8000 and 127. 0.0.1:8000, no difference. The installation itself took several minutes (at least 5 I'd guess, didn't measure it exactly).
@jlrdw Thanks for the reply. I have 32 GB of RAM, 61 % of which is being used right now by various apps.
It si really strange. I am looking at the dev tools in the chrome browser and it says (among other things)
DOMContentLoaded: 6.94 s
Load: 11.54 s
The page has 5 jpg images with the size around 47 kB and one with the size around 80 kB, for each it shows the load time 4.67 s and in the details "Waiting for server response: 4.36 s".
What's your dev setup? On Windows 10/11 if you're using WSL2 and the files are located in the Windows files system you can see lags like what you're describing. Move the site files to the unix filesystem and it's much faster.
@maxxd Hi, thanks for the reply. I am on Windows 11, no WSL (I only know that it is a windows subsystem for linux, but I have never used it – at least not knowingly), no Docker.
How would I do what you are suggesting? Do I need to use Docker for that?
@JussiMannisto Hi, thank you for the reply. The setup is quite simple, just PHP 8.2.12, no XAMPP or other packages. I have the Apache http server installed but I suppose it does not concern this and is not running at the moment.
There is 47 GB of free space on the disk and the computer has been rebooted a few times in the meantime.
I have not changed page file size (it is 15 621 MB); I am sure I have changed some system settings in the past, this is too broad.
@yanzi It does sound strange. I've never experienced this so I'm shooting in the dark. I know Xdebug has been associated with some performance issues in the past. If it's on, you could try disabling it to see if it's the culprit. And check the log files to see if there are any errors, obviously. Other than that I don't know.
Edit. I misread your previous answer. Since you installed PHP manually, did you install all the required extensions?
Recently I had the same problem.
On W10 Machine.
I went from 2000ms to 170ms by adding the project folder to Windows defender exceptions and disabling xdebug extension from php.ini file
using php artisan serve or using laragon both were super slow and that fixed