Skip to content

perf: reduce the number of match calls in metaGenerator#5707

Merged
D-Sketon merged 2 commits intohexojs:masterfrom
D-Sketon:perf/8.0.0-10
Oct 16, 2025
Merged

perf: reduce the number of match calls in metaGenerator#5707
D-Sketon merged 2 commits intohexojs:masterfrom
D-Sketon:perf/8.0.0-10

Conversation

@D-Sketon
Copy link
Member

What does it do?

If we have already determined during the initial check that this.config.meta_generator is true and the user has not inserted an additional generator meta tag, then we do not need to repeat this check on every subsequent page.

Screenshots

Pull request tasks

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

@github-actions
Copy link

How to test

git clone -b perf/8.0.0-10 https://github.com/D-Sketon/hexo.git
cd hexo
npm install
npm test

@coveralls
Copy link

coveralls commented Oct 12, 2025

Pull Request Test Coverage Report for Build 18442055605

Details

  • 7 of 7 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 99.526%

Totals Coverage Status
Change from base Build 18259215002: 0.0%
Covered Lines: 9868
Relevant Lines: 9915

💛 - Coveralls

Copy link
Member

@SukkaW SukkaW left a comment

Choose a reason for hiding this comment

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

Is it even possible to self-unregister the filter? No if is always faster than having if. If we determined the filter is not needed, we can simply skip/unregister the register.

@D-Sketon D-Sketon merged commit b151d98 into hexojs:master Oct 16, 2025
23 checks passed
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.

3 participants