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

fix: performance improvements when meta_generator is disabled #3667

Merged
merged 1 commit into from
Aug 15, 2019

Conversation

SukkaW
Copy link
Member

@SukkaW SukkaW commented Aug 15, 2019

What does it do?

When hexo.config.meta_generator is false, return before cheerio.load.

Discussion: #3663 (comment)

How to test

Environment

  • Travis CI
  • theme-suka/hexo-theme-unit-test as basic hexo site
  • hexo-theme-suka
  • hexo-many-posts: 300 posts that have 1 category, 5 tags, all markdown styles and large amounts of code blocks
  • All the css, js & images are deleted before hexo clean && hexo g to make sure every file generated is rendered HTML.

Screenshots

Raw build log can be found here.

Test A

  • The latest master branch of Hexo from git+https://github.com/hexojs/hexo.git
  • meta_generator set to true

image

694 Files / 20 sec

Test B

  • The latest master branch of Hexo from git+https://github.com/hexojs/hexo.git
  • meta_generator set to false

image

694 Files / 20 sec

Test C

image

694 Files / 8.62 sec

Test D

  • The latest master branch of Hexo from git+https://github.com/sukkaw/hexo.git#meta-generator-config
  • meta_generator set to true

image

694 Files / 20 sec

Test E

  • The latest master branch of Hexo from git+https://github.com/sukkaw/hexo.git#meta-generator-config
  • meta_generator set to false

image

694 Files / 8.56 sec

Pull request tasks

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

return before cheerio.load if meta_generator is disabled
@coveralls
Copy link

Coverage Status

Coverage increased (+0.0008%) to 97.154% when pulling 66fa0e7 on SukkaW:meta-generator-config into 48b506d on hexojs:master.

Copy link
Contributor

@curbengh curbengh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the proper syntax to use.

@curbengh curbengh merged commit 3176fe0 into hexojs:master Aug 15, 2019
@yoshinorin yoshinorin added this to the v4.0.0 milestone Aug 16, 2019
@curbengh curbengh mentioned this pull request Aug 17, 2019
2 tasks
@SukkaW SukkaW mentioned this pull request Aug 22, 2019
4 tasks
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

Successfully merging this pull request may close these issues.

4 participants