Today I read a good article about FreeMarker - an alternative to JSP: http://www.javaworld.com/jw-01-2001/jw-0119-freemarker.html?page=1
Some notes about performance which I were looking for:
- Much like JSP, FreeMarker compiles templates to improve runtime performance. Those templates are stored in memory in a format that leaves placeholders for dynamic data. The controller fills those placeholders with dynamic data from the model. For this purpose, the controller must have access to both the model and the view. Once the dynamic data is retrieved from the model, the controller will print the template to a given output stream.
- Much like JSP, FreeMarker compiles templates to improve runtime performance. Those templates are stored in memory in a format that leaves placeholders for dynamic data. The controller fills those placeholders with dynamic data from the model. For this purpose, the controller must have access to both the model and the view. Once the dynamic data is retrieved from the model, the controller will print the template to a given output stream.
- Once templates are compiled, you can process them in parallel, leading to a significant performance boost.
- For anything other than the most trivial projects, FreeMarker provides a TemplateCache interface, implementations of which act as a repository for precompiled templates.
- An additional feature of TemplateCache objects is that they automatically reload templates when the template source file has changed. That relieves you of having to start and stop the servlet engine when you need to make changes to the HTML.
JSP versus FreeMarker (official documentation): http://freemarker.sourceforge.net/docs/app_faq.html#faq_jsp_vs_freemarker