Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Appreciate your work on this project, using it in numerous Laravel projects myself.
However, I've found myself running a local fork of the project which contains the changes in this PR as I had noticed, at least on the machines I develop with (Windows) there appears to be an issue with the load times when building the Blade template / HTML. On average the load time is around 6~ seconds but in some cases has taken well over 10 seconds for the initial page load.
With regards to the changes -
I noticed an unused variable existed that looked like the intention was to cache the result of the 'isDevelopmentServerRunning' result, so I've gone and implemented this which reduces the 6-10 second load times I was experiencing down to 2~ seconds, as each load calls the 'isDevelopmentServerRunning' function at least 3 times.
However, I looked further into why the request was still taking 2-3~ seconds to initially load and had narrowed it down to the fsockopen call. Doing a bit of research seems to suggest that this call does not use any cached DNS responses from the OS but instead makes a DNS request to the nameserver each time it is called. Swapping to using 'gethostbyname' to resolve the hostname prior to the fsockopen function bought the initial function call time down from >2s to <100ms.
Both changes bring the page load time on the current project I'm working on down from 7s to 800-900ms on average.