JMH benchmark for popular Java template engines:
- Java Native - the baseline. manually created page using byte[] and OutputStream (output Charset : UTF-8)
- Freemarker
- Groovy Template
- Handlebars
- HTTL (Hyper-Text Template Language)
- Jamon
- Apache Tomcat Jasper - JSP and JSPX templating
- Mustache
- Rocker
- Thymeleaf
- Trimou
- Twirl
- Apache Velocity
- Saxon - XSL-T templating
And other engines ... (see branch other-template-engines)
NB: The versions of template engines can be deduced by looking in the pom.xml file. Each template engine should have its version suffixed in the template dir inside final JAR.
Download the source code and build it:
mvn clean verify
If you want to compile, build and launch benchmarks:
mvn clean verify -Pperf
Run the entire benchmark suite:
java -jar target/template-engine-benchmarks-0.0.1-SNAPSHOT.jar
To run a single benchmark, such as Mustache, use:
java -jar target/template-engine-benchmarks-0.0.1-SNAPSHOT.jar MustacheBenchmark
Benchmark result can also be available at https://github.com/jycr/template-engine-benchmarks/wiki