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

Projects
None yet
2 participants
@haumacher
Contributor

haumacher commented Jun 25, 2015

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.

Prevent multiple initializations of the Thymeleaf template engine.
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

This comment has been minimized.

Show comment
Hide comment
@jonbullock

jonbullock Aug 13, 2015

Member

Performance improvements are always welcome 👍

Thanks for the contribution.

Member

jonbullock commented Aug 13, 2015

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

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment