This repository has been archived by the owner on Mar 6, 2019. It is now read-only.
Reduce development build time to < 2 seconds. #484
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I noticed the compile time for the website was pretty slow, so I spent some time making it faster! Developers need to see changes as soon as possible between edits, and on my machine the build time was around two minutes, and sometimes over five minutes.
To get the build time down, I made the build do less. Specifically, disabling responsive image generation, building only one i18n locale (en), and excluding large irrelevant folders that weren't already excluded.
In bullets:
The only way I could figure out how to disable images was by making a stub Liquid interface in Ruby (in the _plugins folder). Overriding the existing plugin with the stub one saves 30-60 seconds of build time, but at the cost that you might accidentally check that override in. So there's another pre-commit check to verify you didn't do that. In the long run we might try to extract the responsive image logic so it's not so tied to Jekyll.
Jekyll is also working on logic such that includes override excludes so you can work on just a page or two at a time, but that's not ready yet. This PR continues to build all pages, but you're free to change that as you work.
Pre-commit still requires a full build of everything, just to be safe. I'm not sure if this is necessary as CI could catch those issues without slowing devs too much.
Steven
Edits: Grammar, image asset copy note