gatsby-plugin-netlify-cms Build times
See original GitHub issueDescription
👋 Following up on a few other issues I read through:
- https://github.com/gatsbyjs/gatsby/issues/18245
- https://github.com/gatsbyjs/gatsby/issues/21900
- https://github.com/gatsbyjs/gatsby/issues/27891
Builds for our site have been pretty long and after debugging, have a few build logs to share:
gatsby-plugin-netlify-cms NO CACHE
[1] success open and validate gatsby-configs - 0.280s
success load plugins - 1.031s
success onPreInit - 0.049s
success initialize cache - 0.005s
success copy gatsby files - 0.045s
success onPreBootstrap - 0.020s
success createSchemaCustomization - 0.014s
success Checking for changed pages - 0.000s
success source and transform nodes - 3.204s
success building schema - 0.698s
info Total nodes: 2275, SitePage nodes: 437 (use --verbose for breakdown)
success createPages - 62.558s
success Checking for changed pages - 0.001s
success createPagesStatefully - 0.290s
success update schema - 0.209s
success onPreExtractQueries - 0.000s
success extract queries from components - 1.163s
success write out redirect data - 0.001s
success Build manifest and related icons - 0.053s
success onPostBootstrap - 0.056s
info bootstrap finished - 72.025s
success run static queries - 0.266s - 18/18 67.67/s
success run page queries - 21.275s - 485/485 22.80/s
success write out requires - 0.009s
success Building production JavaScript and CSS bundles - 126.409s
success Rewriting compilation hashes - 0.003s
success Building HTML renderer - 54.976s
success Building static HTML for pages - 4.940s - 485/485 98.17/s
success Delete previous page data - 0.000s
😢 Algolia search builds are enabled only for production builds
success onPostBuild - 17.007s
info Done building in 298.613864993 sec
Removed plugin NO CACHE
[1] success open and validate gatsby-configs - 0.326s
success load plugins - 1.511s
success onPreInit - 0.051s
success initialize cache - 0.004s
success copy gatsby files - 0.089s
success onPreBootstrap - 0.020s
success createSchemaCustomization - 0.006s
success Checking for changed pages - 0.001s
success source and transform nodes - 0.921s
success building schema - 0.846s
info Total nodes: 2275, SitePage nodes: 437 (use --verbose for breakdown)
success createPages - 6.435s
success Checking for changed pages - 0.000s
success createPagesStatefully - 0.344s
success Cleaning up stale page-data - 0.010s
success update schema - 0.195s
success onPreExtractQueries - 0.002s
success extract queries from components - 1.397s
success write out redirect data - 0.002s
success Build manifest and related icons - 0.064s
success onPostBootstrap - 0.069s
info bootstrap finished - 15.926s
success write out requires - 0.006s
success Building production JavaScript and CSS bundles - 67.019s
success Building HTML renderer - 28.442s
success Building static HTML for pages - 0.001s - 0/0 0.00/s
success Delete previous page data - 0.001s
😢 Algolia search builds are enabled only for production builds
success onPostBuild - 5.165s
info Done building in 117.507162094 sec
That’s a pretty dramatic difference, with cached results showing the same trend. My config for the plugin looks like the following:
{
resolve: 'gatsby-plugin-netlify-cms',
options: {
modulePath: `${__dirname}/src/cms/cms.js`,
manualInit: true,
},
},
I’ve opened up the repo to a team member previously, but didn’t get any feedback on the build times, so I’m happy to do so again if nothing stands out.
Steps to reproduce
Clear steps describing how to reproduce the issue. Please link to a reproduction, this makes your issue much easier to diagnose (seriously).
How to Make a Minimal Reproduction: https://www.gatsbyjs.com/contributing/how-to-make-a-reproducible-test-case/
Expected result
Build times should be impacted THIS much.
Actual result
Build times (and saving CMS files during development) are extremely slow.
Environment
System:
OS: macOS 11.1
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Shell: 3.0.0 - /usr/local/bin/fish
Binaries:
Node: 14.15.4 - /usr/local/bin/node
Yarn: 1.22.5 - ~/.yarn/bin/yarn
npm: 6.14.8 - ~/.npm-packages/bin/npm
Languages:
Python: 2.7.16 - /usr/bin/python
Browsers:
Chrome: 88.0.4324.146
Edge: 88.0.705.63
Firefox: 84.0.2
Safari: 14.0.2
npmPackages:
gatsby: 2.32.2 => 2.32.2
gatsby-plugin-compile-es6-packages: 2.1.0 => 2.1.0
gatsby-plugin-emotion: 5.4.0 => 5.4.0
gatsby-plugin-feed: 2.13.0 => 2.13.0
gatsby-plugin-google-tagmanager: 2.11.0 => 2.11.0
gatsby-plugin-launchdarkly: 0.3.2 => 0.3.2
gatsby-plugin-lodash: 3.10.0 => 3.10.0
gatsby-plugin-manifest: 2.12.0 => 2.12.0
gatsby-plugin-mdx: 1.10.0 => 1.10.0
gatsby-plugin-mdx-embed: 0.0.17 => 0.0.17
gatsby-plugin-mdx-frontmatter: 0.0.2 => 0.0.2
gatsby-plugin-netlify: 2.11.0 => 2.11.0
gatsby-plugin-netlify-cms: 4.10.0 => 4.10.0
gatsby-plugin-react-helmet: 3.10.0 => 3.10.0
gatsby-plugin-react-helmet-canonical-urls: 1.4.0 => 1.4.0
gatsby-plugin-segment-js: 3.6.0 => 3.6.0
gatsby-plugin-sitemap: 2.12.0 => 2.12.0
gatsby-plugin-svgr: 2.1.0 => 2.1.0
gatsby-plugin-webpack-bundle-analyser-v2: 1.1.20 => 1.1.20
gatsby-source-filesystem: 2.11.0 => 2.11.0
npmGlobalPackages:
gatsby-cli: 2.12.117
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (10 by maintainers)
Top GitHub Comments
Moving
cms
out ofsrc
was the fix for me - reloads and general compilation are working as expected still; with decreased build-times. It very well could be something with my setup causing the original issue (using live-MDX and Emotion to render previews, but no graphql) so I’m not sure of a documentation update would be warranted - but leaving this hear for others to try in the future.@zslabs I’m sorry, I don’t work there anymore. And while I’d love to help you, they burned the bridge pretty hard, so I’m not. Best of luck.