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

perf(meta_generator): re-implement as a helper #3669

Closed
wants to merge 3 commits into from

Conversation

curbengh
Copy link
Contributor

@curbengh curbengh commented Aug 15, 2019

What does it do?

From the benchmark performed by @SukkaW , we can see cheerio—used by meta_generator filter—incurs significant perf cost. The feature was initially introduced by #3129.

Despite effort to improve the situation (#3667), the improvement was only minuscule.

As such, I propose to re-implement it as a helper instead, inspired by open_graph(). This approach doesn't require any dep, so it shouldn't incur perf cost.

However, as mentioned in #3663 (comment), this approach also means meta_generator will instead rely on adoption by the themes. Meaning, the adoption will be back to square one.

How to test

git clone -b metagen-helper https://github.com/curbengh/hexo.git
cd hexo
npm install
npm test

Pull request tasks

  • Add test cases for the changes.
  • Passed the CI test.

@coveralls
Copy link

coveralls commented Aug 15, 2019

Coverage Status

Coverage decreased (-0.006%) to 97.148% when pulling 8c33a0f on curbengh:metagen-helper into 3176fe0 on hexojs:master.

@curbengh
Copy link
Contributor Author

curbengh commented Aug 15, 2019

I just thought of a less breaking approach.

Edit: #3671

@curbengh curbengh mentioned this pull request Aug 16, 2019
2 tasks
@curbengh curbengh mentioned this pull request Aug 18, 2019
4 tasks
@curbengh curbengh changed the title feat: re-implement meta_generator as a helper perf(meta_generator): re-implement as a helper Aug 18, 2019
@curbengh
Copy link
Contributor Author

Superseded by #3671

@curbengh curbengh closed this Aug 21, 2019
@curbengh curbengh deleted the metagen-helper branch August 21, 2019 08:07
@SukkaW SukkaW mentioned this pull request Oct 21, 2019
2 tasks
curbengh pushed a commit to curbengh/curbengh.github.io that referenced this pull request Apr 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants