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

Superfast baking with Thymeleaf #220

Merged
merged 1 commit into from
Jun 24, 2016

Conversation

haumacher
Copy link
Member

Currently the Thymeleaf template engine is re-initialized for each and every generated page. Initializing the template engine is a costly operation, because this drops the resolved templates. When initializing the template engine for each page, all used templates must be resolved for each rendering operation. This greatly reduces rendering performance. Instead, the template engine should only be only re-initialized, if the template mode changes.

With this change, baking time for my relatively small recipe dramatically drops from over 13s to around 7s. But I expect an even more dramatic performance boost for larger scenarios.

Initializing the template engine is a costly operation, because this
drops the resolved templates. When initializing the template engine for
each page, all used templates must be resolved for each rendering
operation. This greatly reduces rendering performance. Instead, only
re-initialize the template engine, if the template mode changes.
@jonbullock
Copy link
Member

Performance improvements are always welcome 👍

Thanks for the contribution.

@jonbullock jonbullock added this to the v2.5.0 milestone Aug 13, 2015
@jonbullock jonbullock self-assigned this Aug 13, 2015
@jonbullock jonbullock merged commit 6e4a165 into jbake-org:master Jun 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants