-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"update schema" step really slow after upgrading from 2.17 to 2.18 #20395
Comments
There have been some changes to graphql. Could you post the whole output before and after? I'm half expecting (or hoping? :) ) that the time is moved to a different step and that the total runtime is about the same. If that's not the case I'm definitely going to look into it as this is not a regression I'd be keen on keeping. |
@vladar anything on your radar that might relate to this? |
This is the whole output from 2.17.6:
And this the one from 2.18.12:
As you can see:
All in all, the difference between two versions is about ~11 seconds. Since we have switched off type inference for SitePage.context, shouldn't "update schema" step be faster, or even bypassed? We effectively know that we haven't changed any field after createPages, so could be opt-out of that schema update just like we did with type inference for SitePage.context? |
More info about this issue. We have removed the "update schema" step (following directions from #14797 (comment)) and our build time has gone down from 177 sec to 127 sec, 50 seconds less:
We haven't detected any issue with the resulting public folder, so we think that the problem comes from Gatsby not properly honoring that we have switched off type inference for SitePage.context. It's that assumption ok? |
I need to check this when I have a moment and then will get back to you. Minimum reproduction could have helped a lot (disabling inference for SitePage and then showing that inference still occurs, i.e. |
Confirmed this. A PR with a fix: #20662 |
Description
Site with 20k pages, currently using version 2.17.6. We pass JSON data via context (hence not using GraphQL), so we have switched off type inference for SitePage.context to speed up compilation, as stated here.
These are the timings we get using 2.17.6:
After upgrading from 2.17.6 to 2.18.12, "update schema" step is taking ~40 seconds instead of 0.051s:
It's this problem related to "update schema" step not taking into account that type inference is disabled for SitePage.context?
Steps to reproduce
Our repo is private, but we are willing to provide access to any Gatsby employee (maybe @pvdz)
Expected result
"update schema" step should not take any time, as it did with v2.17.6.
Actual result
It takes ~40 seconds instead of ~0s
Environment
The text was updated successfully, but these errors were encountered: