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

Break when we successfully generate nav link. #3291

Merged
merged 1 commit into from Jan 12, 2015

Conversation

Projects
None yet
3 participants
@flyinprogrammer
Contributor

flyinprogrammer commented Jan 12, 2015

So in liquid 2.5.0 they added break and continue support: https://github.com/Shopify/liquid/blob/master/History.md#250--2013-03-06

So our build time loop that invokes this code looks something like this:
for every page:
for every section in our docs.yml
for every doc in our yaml section
for every doc in our site.docs collection
build a link {sadly, we need the page title so this nested mess is needed}

Without the break we iterate through every doc for every link, this will at least stop the last doc loop once we've built the link.

Non-scientific performance measurement/improvement:

Without break:
$ time jekyll build
Configuration file: /home/flyinprogrammer/Development/jekyll/site/_config.yml
Source: /home/flyinprogrammer/Development/jekyll/site
Destination: /home/flyinprogrammer/Development/jekyll/site/_site
Incremental build: enabled
Generating...
done.
Auto-regeneration: disabled. Use --watch to enable.

real 0m13.930s
user 0m13.501s
sys 0m0.065s

With break:
$ time jekyll build
Configuration file: /home/flyinprogrammer/Development/jekyll/site/_config.yml
Source: /home/flyinprogrammer/Development/jekyll/site
Destination: /home/flyinprogrammer/Development/jekyll/site/_site
Incremental build: enabled
Generating...
done.
Auto-regeneration: disabled. Use --watch to enable.

real 0m11.084s
user 0m10.815s
sys 0m0.067s

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Jan 12, 2015

Member

This is awesome! Thank you!!

Member

parkr commented Jan 12, 2015

This is awesome! Thank you!!

parkr added a commit that referenced this pull request Jan 12, 2015

@parkr parkr merged commit e7feae9 into jekyll:master Jan 12, 2015

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details

parkr added a commit that referenced this pull request Jan 12, 2015

@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.