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

Performance of generate script #2449

Open
tunetheweb opened this issue Nov 7, 2021 · 0 comments
Open

Performance of generate script #2449

tunetheweb opened this issue Nov 7, 2021 · 0 comments
Labels
development Building the Almanac tech stack performance Issues related to site performance
Milestone

Comments

@tunetheweb
Copy link
Member

We have a NodeJS npm run generate command, which generates all the chapters, and generates the featured quotes (which requires having processed all the chapters), and generates the ebook.

In GitHub actions we also test and export every web page and save the actual HTML (as opposed to the Jinja2 HTML Templates that the generate script generates that aren't fully HTML as includes Jinja functions), and then lint them.

Finally we run Lighthouse on any chapters changed, plus a few base chapters (in case we change core stuff like CSS or python).

This is all fantastic and automated and gives us real confidence in merging PRs. It also allows PR authors to address a lot of issues before maintainers even get there.

However, this is starting to get slow as more translations, and more years are added.

In GitHub Actions it typically takes 9 mins to run the Test Web Site action, including:

  • 1 minutes 30 to download the GitHub super linter image for linting
  • 2 minutes 30 to generate and test the website
  • 2 minutes 30 to lint the generated HMTL (this is done for ALL the site).
  • 1 minute 30 to run the Lighthouse tests

Now we do have the ability to generate a single chapter (or subset of the site):

npm run generate en/2021/pwa

And also have the ability to auto generate the chapter on save:

npm run watch

However some may not realise this. Plus both those options exclude the featured quotes on the year home page, which are useful for people to see.

Should we look at improving the performance or is it good enough? Most people use it through GitHub Actions and probably don't really notice/care that it's slow. But for those running it locally it's more of an issue/annoyance.

Ideas:

  • Parallelise the years in our JavaScript script
  • Add featured quote regen to chapter only and watch scripts
  • Move HMTL linting to separate GitHub Actions (but so much is repeated!)
  • Move Lighthouse to separate GitHub Actions (but so much is repeated!)
  • Remove/Consolidate some of our dependencies (JSDom, Prettier, Showdown, SmartyPants)
  • Move to a new tech stack from the SSG part (11ty?)
@tunetheweb tunetheweb added the performance Issues related to site performance label Nov 7, 2021
@rviscomi rviscomi added the development Building the Almanac tech stack label Nov 8, 2021
@rviscomi rviscomi added this to the 2021 Backlog milestone Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Building the Almanac tech stack performance Issues related to site performance
Projects
None yet
Development

No branches or pull requests

2 participants