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

getFrontMatter() invoked multiple times #55

Closed
aedart opened this issue Jun 6, 2018 · 1 comment
Closed

getFrontMatter() invoked multiple times #55

aedart opened this issue Jun 6, 2018 · 1 comment

Comments

@aedart
Copy link
Contributor

aedart commented Jun 6, 2018

In an attempt to design a possible cache solution (#51), I found that \Todaymade\Daux\Tree\Content::getFrontMatter() might be invoked multiple times:

  • From \Todaymade\Daux\Tree\Content::getContent()
  • And from \Todaymade\Daux\Tree\Content::parseAttributes()

I'm not too sure about this being a defect - But if I read the code correctly, then markdown content is parsed twice, which does have some negative effect on performance. Should getFrontMatter() not return evt. previously rendered content, if any is available?

@onigoetz
Copy link
Contributor

onigoetz commented Jun 6, 2018

Hello,

I made the change to call it only once.

The change doesn't give a big performance boost : https://blackfire.io/profiles/f105b698-8393-4058-8707-ea2f2b1ee69e/graph

2% is not a lot, but it's still something :)

onigoetz added a commit that referenced this issue Jun 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants