Optimize Switch for Constants

The FreshMarker Switch Directive is an unusual representative of its kind. Since it has been implemented according to the possibilities of its syntax description in the CongoCC example source code, it is capable of quite unusual working methods. Some special cases could be processed faster with an optimized version. Therefore, the Switch Directive is optimized for constants in this article.

List Directive Unrolled

The Partial Template Reduction feature allows FreshMarker templates to be simplified. Part of the model is used to evaluate expressions in directives and interpolations and generate a new template. A template reduced in this way contains fewer dynamic and more static parts and can therefore be evaluated more quickly. Until now, list directives were excluded from the simplification options. This can now change under certain circumstances.

FreshMarker Variable Scope Revised

The blog posts on the FreshMarker template engine pursue several goals. On the one hand, the posts should of course entertain their readers. On the other hand, they also serve me to focus and document my ideas on various aspects of the implementation. One very interesting topic in this post is the management of variables within the Template Engine.