Skip to content

Concurrent rendering of nunjucks tags within a post #4923

@ppwwyyxx

Description

@ppwwyyxx

Check List

Please check followings before submitting a new feature request.

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

Feature Request

Currently, if we use async rendering in custom tag plugins, rendering of tags can run concurrently between posts. However, tags within the same post are still rendered sequentially.

This is because when rendering a post, hexo makes a single render call to nunjucks to render the entire post. Inside nunjucks, it renders all the tags sequentially.

I have a custom tag plugin that needs to make expensive async calls, so it could benefit a lot from within-post async rendering of tags.

Others

I have made a draft implementation of this feature at ppwwyyxx@17565f7 . Instead of making one render call per-post, it finds each nunjucks tag in the post and call render on each of them.

This diff has improved my whole-site generation speed by 10x.

I would like to hear:

  • Whether the feature makes sense to add
  • If the above is yes, whether my implementation is in the right direction. If so I could start a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions