Skip to content

fix: avoid unnecessary Buffer conversion for large string content#5745

Closed
quetta-1030 wants to merge 1 commit intohexojs:masterfrom
quetta-1030:fix/buffer-performance
Closed

fix: avoid unnecessary Buffer conversion for large string content#5745
quetta-1030 wants to merge 1 commit intohexojs:masterfrom
quetta-1030:fix/buffer-performance

Conversation

@quetta-1030
Copy link

What does it do?

Fixes Issue #5705 - Avoid unnecessary Buffer conversion for large string content. When generating large web pages, Buffer.from( data) in the router causes performance overhead. This change directly returns the string instead of converting to Buffer, improving performance for large content.

Screenshots

(N/A - performance improvement)

Pull request tasks

  • Add test cases for the changes. - Added test for large string content in test/scripts/hexo/router.ts
  • Passed the CI test

- Directly return string to avoid Buffer.from() overhead for large content
- This improves performance when generating large web pages
- Closes #5705
@github-actions
Copy link

github-actions bot commented Mar 6, 2026

How to test

git clone -b fix/buffer-performance https://github.com/quetta-1030/hexo.git
cd hexo
npm install
npm test

@quetta-1030 quetta-1030 closed this by deleting the head repository Mar 8, 2026
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.

1 participant