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.