fix: performance improvements when meta_generator is disabled #3667
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does it do?
When
hexo.config.meta_generator
isfalse
, return beforecheerio.load
.Discussion: #3663 (comment)
How to test
Environment
theme-suka/hexo-theme-unit-test
as basic hexo sitehexo-theme-suka
hexo-many-posts
: 300 posts that have 1 category, 5 tags, all markdown styles and large amounts of code blocksScreenshots
Raw build log can be found here.
Test A
git+https://github.com/hexojs/hexo.git
meta_generator
set to true694 Files / 20 sec
Test B
git+https://github.com/hexojs/hexo.git
meta_generator
set to false694 Files / 20 sec
Test C
git+https://github.com/hexojs/hexo.git
meta_generator
set to falsesed -i "s|filter.register('after_render:html', require('./meta_generator'))|//filter.register('after_render:html', require('./meta_generator'))|g" ./node_modules/hexo/lib/plugins/filter/index.js
to comment out https://github.com/hexojs/hexo/blob/master/lib/plugins/filter/index.js#L14694 Files / 8.62 sec
Test D
git+https://github.com/sukkaw/hexo.git#meta-generator-config
meta_generator
set to true694 Files / 20 sec
Test E
git+https://github.com/sukkaw/hexo.git#meta-generator-config
meta_generator
set to false694 Files / 8.56 sec
Pull request tasks