Skip to content
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

[Misc] Research caching to improve yarn build times #199

Closed
3 tasks
zstix opened this issue Oct 29, 2020 · 7 comments
Closed
3 tasks

[Misc] Research caching to improve yarn build times #199

zstix opened this issue Oct 29, 2020 · 7 comments
Assignees

Comments

@zstix
Copy link
Contributor

zstix commented Oct 29, 2020

Descriptions

Running yarn build or yarn develop can take over 2 minutes to run for a fresh install and the repository currently only represents 10% of the total amount of content. This is a bit of a deterrent for new people who want to jump in and contribute.

We need to do some research into how to lower this build time and ensure we can scale up the amount of content without exponentially increasing build times. Caching images and queries may be one way to achieve this, but it doesn't solve the issue for new developers.

Acceptance Criteria

Since this is somewhat vague, we will probably want to timebox this effort to no more than 4 hours (for now).

  • Identify options for reducing the build time
  • Decide on which options we would like to take
  • Either execute the options, or add them to our backlog
@zstix
Copy link
Contributor Author

zstix commented Oct 30, 2020

We have done some research on this issue during a previous MMF: #32

We may be able to utilize incremental builds to help improve this process.

It's possible that this issue has been solved by the Gatsby community.

@zstix
Copy link
Contributor Author

zstix commented Oct 30, 2020

https://www.gatsbyjs.com/docs/conditional-page-builds/

@zstix
Copy link
Contributor Author

zstix commented Oct 30, 2020

https://bulletninja.com/enable-gatsby-incremental-builds-aws-amplify

Here's some more information about that: https://bulletninja.com/enable-gatsby-incremental-builds-aws-amplify

@zstix zstix added the sp:8 label Oct 30, 2020
@caylahamann caylahamann self-assigned this Nov 3, 2020
@caylahamann
Copy link
Contributor

caylahamann commented Nov 6, 2020

With the update of Gatsby to the newest version, caching has dramatically improved.

  • yarn develop without caching ~ 3 minutes (largest culprits are running page queries takking 75 seconds and generating image thumbnails which take 125.578s)
  • yarn develop with caching - ~ 8 seconds

So there is a long initial start, but as long as someone doesn't run gatsby clean or makes changes to the gatsby apis (which content creators are not likely to do) this shouldn't be too much of an issue. Possible ways to improve build times:

  • Cloudinary as an asset management tool. We can easily integrate into gatsby via a plugin, the tooling in the website seems to be simple and easy to use, and we would be able to add transform the images via our migration script. This might take a bit of work, but it should cut down on the generating of image thumbnails (especially as migration continues).
  • Conditional Builds this wouldn't help our development process, but would ensure slightly faster builds in amplify.

@caylahamann
Copy link
Contributor

without images and no caching - 141.587781166 s
with images and no caching - 179.265728646 s

We could also limit the number of pages built during development. If a contributor knows that they only want to develop on a certain page, we can put that as an input and then just modify the query for development.

@caylahamann
Copy link
Contributor

  • make ticket with pricing info for cloudinary

@caylahamann
Copy link
Contributor

followed up with this ticket: #257

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants