When building my massive site a lot of unreported time is spent doing something mysterious between "load plugins" and "onPreInit" #38874
-
When building a production build or running the dev server, it hangs after the Once it's finished, the total bootstrap time is reported as 3614.893s, but summing the times reported by the build steps only adds up to 306.684s. So either one of these steps is being mis-timed, or there's something happening between the steps which isn't being timed, possibly something between My site is very huge (over 48,000 nodes) so it presents weird issues like this sometimes, which is why I'm not reporting it as a bug since it's likely very hard to reproduce and probably nobody else is experiencing it. Does anyone have any ideas or can point me to where to start investigating? I can see there's a few things happening between those steps in This is the entire build output from
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Okay, so I added timer functions to the tasks between load plugins and onPreInit and ran
So that answers the question of where that time is being spent. The next question is what is happening when it's removing stale jobs and why is it taking so long? Sidenote: Should these tasks be timed by default? Or maybe just with a verbose option? Seems weird that some build tasks are timed and some aren't. Maybe I should start an issue requesting that feature. edit: Okay, I think I've figured it out. Because my site has so many files (many of which are quite big) file hashing work takes a long time - a lot of problems were solved for me when we added the fastHash feature which skips the cryptographic hash and just uses a slightly less robust digest of mtime and filesize. But it looks like when checking for stale jobs (isJobStale) each file is sha1 hashed, which is gonna take a long time for my site. I don't fully understand how this job stuff works yet, but ideally we could extend the behaviour of the fastHash parameter (or make a new one) to also do the faster hashing method here in core. I will play around with this and see if I can get something resembling a PR. |
Beta Was this translation helpful? Give feedback.
Okay, so I added timer functions to the tasks between load plugins and onPreInit and ran
npm start
again. This was the result:So that answers the question of where that time is being spent. The next question is what is happening when it's removing stale jobs and why is it taking so long?
Sidenote: Should these tasks be timed by default? Or maybe just with a verbose option? Seems weird that some build tasks are timed and some aren't. Maybe I should start an issue requesting that feature.
edit: Okay, I think I've figured it out. Because my site has so many files (many of which are quite …