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

Cache the list of documents to be written #6741

Merged
merged 2 commits into from Feb 18, 2018

Conversation

Projects
None yet
6 participants
@ashmaroli
Member

ashmaroli commented Feb 4, 2018

To avoid multiple traversal of the Site#documents array using Array#select and Document#write?

jekyll/lib/jekyll/site.rb

Lines 317 to 324 in 0f2c27b

# Get all the documents
#
# Returns an Array of all Documents
def documents
collections.reduce(Set.new) do |docs, (_, collection)|
docs + collection.docs + collection.files
end.to_a
end

jekyll/lib/jekyll/site.rb

Lines 310 to 315 in 0f2c27b

# Get the to be written documents
#
# Returns an Array of Documents which should be written
def docs_to_write
documents.select(&:write?)
end

@DirtyF DirtyF requested a review from jekyll/performance Feb 4, 2018

@DirtyF

DirtyF approved these changes Feb 4, 2018

@oe

oe approved these changes Feb 4, 2018

@parkr

This should be reset in Site#reset or else the watch server won’t pick up differences in documents.

@ashmaroli ashmaroli referenced this pull request Feb 17, 2018

Closed

Release 3.8.0 #6783

12 of 13 tasks complete
@DirtyF

This comment has been minimized.

Member

DirtyF commented Feb 18, 2018

@jekyllbot: merge +minor

@jekyllbot jekyllbot merged commit 6470646 into jekyll:master Feb 18, 2018

3 checks passed

WIP ready for review
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@ashmaroli ashmaroli deleted the ashmaroli:cache-docs-to-write-array branch Feb 18, 2018

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