Details
-
Type:
Story
-
Status: Needs Triage
-
Priority:
Unset
-
Resolution: Unresolved
-
Affects versions: None
-
Fix versions: None
-
Labels:
-
Sprint:Next
Description
As a developer, I would like Prospectus build times to be faster to improve development speed, and reduce the time needed to deploy changes to the website.
Background
Gatsby includes a benchmarks directory (https://github.com/gatsbyjs/gatsby/tree/master/benchmarks) in its project that allows you to get estimates for speeds of various use cases. When running these benchmarks for roughly the same number of pages we create on prospectus (~13324), we see that our page queries, and especially our page builds are much slower than the benchmarks.
Gatsby create pages benchmark run:
... success run static queries - 0.002 s success Building production JavaScript and CSS bundles - 2.790 s success run page queries - 24.041 s — 13324/13324 555.49 queries/second success Building static HTML for pages - 16.841 s — 13324/13324 800.89 pages/second info Done building in 71.14 sec
Gatsby markdown benchmark run:
...⠀ success run static queries - 0.004 s success Building production JavaScript and CSS bundles - 13.045 s success Rewriting compilation hashes - 0.073 s success run page queries - 202.963 s — 13324/13324 65.67 queries/second success Building static HTML for pages - 59.094 s — 13324/13324 228.98 pages/second info Done building in 315.724 sec
The relevant portions from a prospectus build:
success run page queries - 279.872 s — 13323/13323 47.61 queries/second success Building static HTML for pages - 322.152 s — 13323/13323 42.77 pages/second
Our page query speed is closer to the markdown benchmark, so that one may not be able to improved a ton, but it certainly seems like we can greatly improve our page build speed.
success run page queries - 3733.381 s — 13329/13329 3.57 queries/second
Another run of our page queries is absurdly slow
Acceptance Criteria
The page build speed (and hopefully the page query speed too) is improved to a level deemed acceptable by the team, with data collected on performance before and after the change.
Other Notes
https://www.gatsbyjs.org/blog/2019-01-28-building-a-large-ecommerce-website-with-gatsby-at-daniel-wellington/ has some notes on improving gatsby build times, although we likely will not want to take all the same steps they took for improving build time.
https://github.com/gatsbyjs/gatsby/issues/15628 Gatsby issue on this