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

[Proposal] Use memoize in our helper and util function #4782

Closed
2 tasks done
SukkaW opened this issue Sep 22, 2021 · 0 comments · Fixed by #4789
Closed
2 tasks done

[Proposal] Use memoize in our helper and util function #4782

SukkaW opened this issue Sep 22, 2021 · 0 comments · Fixed by #4789
Labels
enhancement New feature or request #perfmatters

Comments

@SukkaW
Copy link
Member

SukkaW commented Sep 22, 2021

Check List

Please check the followings before submitting a new feature request.

  • I have already read Docs page
  • I have already searched existing issues

Description

Most of the time, generation speed is slow not because Hexo itself is slow, but the badly written theme. E.g. #1769 turns out that the theme didn't use fragment_cache on tagscloud helper.

Theme developers might not read our developing documents carefully and such issues can still happen. What if we can always cache the tagscloud helper (and such) at our side? And what if we can cache tag plugins (used in the posts) as well?

And here is memoized function comes in.

During the development of Hexo 4.2.0, I have introduced cache in some methods of hexo-util. But with the current implementation, we can only memoize functions with simple parameters. We should use some libraries to cache functions with complex parameters as well.

Other Information

@SukkaW SukkaW mentioned this issue Sep 22, 2021
@SukkaW SukkaW added the enhancement New feature or request label Sep 22, 2021
@SukkaW SukkaW mentioned this issue Oct 2, 2021
2 tasks
@stevenjoezhang stevenjoezhang linked a pull request Oct 2, 2021 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request #perfmatters
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant