-
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
Question: Any tips for speeding up building/update schema steps? #4055
Comments
Currently no way to do this, but I have started doing some work on assisting schema creation. Originally it was focused on enforcing schema types but this could be extended to take over schema creation completely for sure. If you are interested - check master...pieh:schema_wip (just note that this is big undertaking and I didn't have time recently to work on this, so nothing was done in last month). I am actually interested in your complex example if you can share it - I try do some performance comparison between current code and changes I propose. So far I was using https://github.com/freeCodeCamp/guides which has 2764 markdown files but they all are similar and doesn't seem to affect total build time that much (schema creation take 1s-1.5s when I build locally) |
Sure, here is the site in question: https://github.com/avaclancheuk/destiny-clan-warfare. Just a heads up if you run it, it is calling out to a lot of API endpoints for data, so the |
Sounds like something pathological in your data. I've never seen schema creation take longer than ~1.5seconds. |
BTW, one quick way of speeding up sourcing is to parallelize fetches in your E.g. |
@KyleAMathews Thanks for the parallelization tip, I'll give that a shot. Could complex nested child arrays with lots of data be a potential issue for my schema creation? |
Potentially. It's hard to say without profiling your exact data. There's other sites with lots of nested data that doesn't have problems. |
ok, thanks. I'll start digging and see if I can find the bottlenecks |
I have managed to speed up sourceNodes no end by parallelizing my fetches. I now need to dig into the node creation further to find the bottle necks |
So |
It would appear that the sheer volume of nodes is what's causing the bottlenecks. I'm not investigating alternate storage methods that bypass graphql |
Is there any way to help Gatsby know the expected schema for the nodes I'm creating so that it doesn't need to infer them?
I currently have quite complex node structures and it's resulting in both these steps taking about 30 seconds each to complete?
The text was updated successfully, but these errors were encountered: