question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

gatsby-plugin-netlify-cms Build times

See original GitHub issue

Description

👋 Following up on a few other issues I read through:

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:closed
  • Created 3 years ago
  • Comments:13 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
zslabscommented, Mar 16, 2021

Moving cms out of src 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.

1reaction
pvdzcommented, Feb 9, 2021

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cut build times with Gatsby Runner - Netlify
gatsby build . Gatsby Build completes in 6m 50.8s, with a total build time of 8m 52s and total deploy time of 9m....
Read more >
Sourcing from Netlify CMS - Gatsby
Once you connect your GitHub repo to Netlify, deployment will begin. Note that the first deployment could take a few minutes since a...
Read more >
@talves/gatsby-plugin-netlify-cms NPM | npm.io
This will cut down on your Gatsby build time and you would build local when you make changes that affect the CMS build....
Read more >
How to Set Up Gatsby with Netlify CMS - Code Concisely
Setting up Netlify CMS for the first time can be a bit confusing. ... npm install netlify-cms-app gatsby-plugin-netlify-cms.
Read more >
Gatsby | Open-Source Content Management System
We'll need netlify-cms-app and gatsby-plugin-netlify-cms . Run the following command in the ... It's time to create your first blog post.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found