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

Memoize document output extension #6814

Merged
merged 1 commit into from Mar 14, 2018

Conversation

Projects
None yet
4 participants
@ashmaroli
Member

ashmaroli commented Feb 28, 2018

This is to avoid creating new instances of Jekyll::Renderer each time Document#output_ext is called

@ashmaroli ashmaroli added this to the v3.8.0 milestone Feb 28, 2018

@DirtyF DirtyF requested a review from jekyll/stability Feb 28, 2018

@parkr

parkr approved these changes Feb 28, 2018

I really hope none of these attributes we keep memoizing change between creation of the instance and the usage of the attribute!

@ashmaroli

This comment has been minimized.

Member

ashmaroli commented Mar 1, 2018

I really hope none of these attributes we keep memoizing change

@parkr The other alternative is to create a single private Renderer instance like how its done in Jekyll::Convertible

# lib/jekyll/document.rb

def output_ext
  renderer.output_ext
end

private
def renderer
  @renderer ||= Jekyll::Renderer.new(site, self)
end

@DirtyF DirtyF requested a review from jekyll/core Mar 1, 2018

@parkr

This comment has been minimized.

Member

parkr commented Mar 1, 2018

This PR is fine by me, @ashmaroli.

@oe

oe approved these changes Mar 14, 2018

@oe

This comment has been minimized.

Member

oe commented Mar 14, 2018

@jekyllbot: merge +dev

@jekyllbot jekyllbot merged commit 68315ce into jekyll:master Mar 14, 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:memoize-document-extn branch Mar 14, 2018

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