In my previous post on https://dev.to/nasrulhazim/load-dynamically-livewire-components-from-different-namespace-574j, I've hit an issue which causing my boot time to load the Laravel application is very slow. On my machine, it run about 500-800ms, but for my team, sometimes they hit around 5-6 minutes to load for just a page.

So the journey begin to find out what's the issue, why it's taking so long to boot up. At first, I'm looking at my route files, which I have a lot of route files been loaded dynamically like the following: collect(glob(base_path('/routes/web/*.php'))) ->each(function ($path) { require $path; }); Enter fullscreen mode

You can imagined how many files under app/ directory need to be load on initial load.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners