Very poor graphql performance with gatsby-plugin-mdx
when compared with gatsby-transformer-remark
#29438
Labels
type: bug
An issue or pull request relating to a bug in Gatsby
Description
In a gatsby app set up with a non-trivial amount of MDX files (500 4kb files), graphql performance seems to be much slower than expected, both the
source and transform nodes
step, and thepage queries
step. Here are the times I've recorded during build, running in a github action for comparison purposes.MDX Action
Markdown Action
Steps to reproduce
I've created a minimal reproduction here. This is just the starter project with
gatsby-plugin-mdx
added, a basicgatsby-node
file to create the pages, and a basic template with a simple page query.master
usesgatsby-plugin-mdx
,markdown
usesgatsby-transformer-remark
.Expected result
I'm expecting some increase in the
transform and source
step (though ideally not a 100x increase like I'm seeing), since obviously MDX is much more complex than plain markdown. But I'm not expecting to see such a large increase in page query time for MDX node queries.Actual result
The current times make building any large MDX-based site extremely painful! The gatsby cache helps alleviate the page query pain (but not the sourcing/tranformations), but isn't something we can rely on for every build.
I'm working on an open-source documentation website that is leveraging MDX. Currently, at 1500 pages, we're really feeling the pain of these slow builds, and our site will easily double or triple in content size soon. So we're extremely interested in any possibilities to increase the build speed of MDX-based gatsby apps.
Any help or suggestions are extremely appreciated, thank you!
Environment
This from my local, not the github actions, but it may still be useful as I experience very similar times locally.
The text was updated successfully, but these errors were encountered: