mbosecke / template-benchmark Goto Github PK
View Code? Open in Web Editor NEWJMH benchmark of the most popular Java template engines
License: BSD 3-Clause "New" or "Revised" License
JMH benchmark of the most popular Java template engines
License: BSD 3-Clause "New" or "Revised" License
Thymeleaf 3.0.0 is now released and could be curious to see the performance improvement.
As brought up by @mkouba in pull request #3, my recent modifications might have given mustache an unfair advantage. Before the benchmark begins it does some pre-processing on the data; processing that other templates don't have a chance to do until the are being timed.
For embedded projects that require templating
Please add Jtwig to comparision.
http://jtwig.org/
https://github.com/javamonkey/template-benchmark
This is the result of running on my computer.
The environment:
The output is not the same for all templating engines.
stocks.mustache.html:
${["odd", "even"][item_index%2]}
is ignored so don't get the correct class for odd/even rows${item_index + 1}
is ignored so don't get the index<td class="minus">
You should either remove these parts from all templates or implement this with mustache.java (I think you would have to implement some TemplateFunction
to get the same functionality).
Also I would add a test to compare the output of all benchmarks.
The Rocker template does not check if the "minus" class should be applied or not. The class is always set!
Example:
<td class="minus">@item.getChange()</td>
So, the results are not similar, and the benchmark is not fair.
The data file contains "com.mitchellbosecke.benchmark.Freemarker.benchmark", the plot currently transforms that into "Freema", but ideally the plot will display "Freemarker".
I don't know enough about gnuplot to fix this.
HtmlFlow is a Java DSL to write typesafe HTML documents.
HtmlFlow competes with the most performant template engine, i.e. Rocker and is faster than the remaining concurrency.
HtmlFlow is widely used to build dynamic HTML documents, such as papers, reports, emails, etc, involving complex programing tasks which are hardly achieved through textual templates. Moreover, HtmlFlow can also be used as a web template engine allying its performance boost with its HTML strongly type safety characteristics.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.