Demo project to show different Java templating engines in combination with Spring boot MVC at https://ozkanpakdil.github.io/spring-comparing-template-engines/
View the Project on GitHub ozkanpakdil/spring-comparing-template-engines
lower is the better
Engine Name | Seconds |
---|---|
jsp | 2.331 |
velocity | 7.866 |
freemarker | 1.983 |
thymeleaf | 4.786 |
mustache | 2.216 |
pebble | 2.688 |
handlebars | 11.440 |
htmlFlow | 1.272 |
trimou | 1.591 |
rocker | 1.497 |
groovy | too slow |
kotlinx | 2.339 |
jte | 1.797 |
results taken from mvn and jvm :Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937) Maven home: /usr/share/apache-maven-3.9.9 Java version: 24.0.1, vendor: Eclipse Adoptium, runtime: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/24.0.1-9/x64 Default locale: en, platform encoding: UTF-8 OS name: “linux”, version: “6.11.0-1014-azure”, arch: “amd64”, family: “unix”
Runs performance test(ab -q -n 10000 -c 10 http://localhost:8080/TEMPLATE) from Github Actions and updates here.
If you are planning to use any template engine from the list, choose wisely, lowest is the best performance.