Skip to content

Commit

Permalink
Merge branch 'plots'
Browse files Browse the repository at this point in the history
  • Loading branch information
fmcarvalho committed Jan 25, 2024
2 parents 5b16cd0 + 0abe8f0 commit 04b12b9
Show file tree
Hide file tree
Showing 12 changed files with 286 additions and 196 deletions.
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ JMH benchmark for popular Java template engines:
* [j2Html](https://j2html.com/)
* [KotlinX Html](https://github.com/Kotlin/kotlinx.html)
* [HtmlFlow](https://github.com/xmlet/HtmlFlow)

* [JStachio](https://github.com/jstachio/jstachio)

Running the benchmark
======================
Expand Down Expand Up @@ -48,15 +48,21 @@ Interpreting the Results
The benchmarks measure throughput, given in "ops/time". The time unit used is seconds.
Generally, the score represents the number of templates rendered per second; the higher the score, the better.

Example Results (2023, with HtmlFlow 4)
Example Results (2024, with HtmlFlow 4 and JStachio)
===============================

**Upgrade releases of HtmlFlow to 4.1 and Kotlinx.html to 0.7.5**
**Upgraded all releases of templates including HtmlFlow to 4.3 and add new template engine JStachio**

These tests were performed in Github Actions
with `Ubuntu 22.04, 4 CPU and 16 GB RAM` according to [GitHub-hosted runners for Public repositories](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories).


Plots are generated from the data collected in this [run](https://github.com/xmlet/template-benchmark/actions/runs/7644609042)

<table>
<tr>
<td><img src="results-presentations-HF4.svg"></td>
<td><img src="results-stocks-HF4.svg"></td>
<td><img src="results/results-presentations.svg"></td>
<td><img src="results/results-stocks.svg"></td>
</tr>
</table>

Expand All @@ -72,15 +78,15 @@ These tests were performed on a local machine with the following specs:

```
Mac OS Version 13.4.1
Apple MacBook M1 Pro, 8 Coresa and 16 GB RAM
Apple MacBook M1 Pro, 8 Cores and 16 GB RAM
OpenJDK Runtime Environment Corretto-17.0.5.8.1
OpenJDK 64-Bit Server VM Corretto (build 17.0.5+8-LTS)
```

<table>
<tr>
<td><img src="results-presentations-HF3.svg"></td>
<td><img src="results-stocks-HF3.svg"></td>
<td><img src="results/results-presentations-HF3-2023.svg"></td>
<td><img src="results/results-stocks-HF3-2023.svg"></td>
</tr>
</table>

Expand All @@ -99,7 +105,7 @@ Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)

<table>
<tr>
<td><img src="results-presentations-HF3-2019.svg"></td>
<td><img src="results-stocks-HF3-2019.svg"></td>
<td><img src="results/results-presentations-HF3-2019.svg"></td>
<td><img src="results/results-stocks-HF3-2019.svg"></td>
</tr>
</table>
17 changes: 12 additions & 5 deletions benchmark.plot
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Labels
set title 'Java Template Engine Performance Comparison'
set ylabel 'Templates rendered per Ms'
set xlabel 'Template Engine'
set xtics nomirror rotate by -45
Expand All @@ -12,10 +11,8 @@ set datafile separator ','

# Output
set terminal svg enhanced standalone
set output 'results.svg'
set grid
set key off
set boxwidth 0.8 relative

# box style
set style line 1 lc rgb '#5C91CD' lt 1
Expand All @@ -26,5 +23,15 @@ set style line 2 lc rgb '#808080' lt 1
set border 3 back ls 2
set tics nomirror

plot 'results.csv' every ::1 using 0:5:xticlabels(stringcolumn(1)[31:50]) with boxes ls 1,\
'results.csv' every ::1 using 0:($5):(sprintf("%d",$5)) with labels

files = 'stocks presentations'

do for [dataset in files] {
set title dataset
set output 'results-'.dataset.'.svg'

plot 'results-'.dataset.'.csv' every ::1 using 0:5:(0.8):0:xticlabels(stringcolumn(1)[31:50]) with boxes lc variable, \
'results-'.dataset.'.csv' every ::1 using 0:($5 + 5):(sprintf("%d",$5)) with labels

set output
}
File renamed without changes.
File renamed without changes
File renamed without changes
13 changes: 13 additions & 0 deletions results/results-presentations.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"Benchmark","Mode","Threads","Samples","Score","Score Error (99.9%)","Unit"
"com.mitchellbosecke.benchmark.Freemarker","thrpt",1,4,111.512361,2.833235,"ops/ms"
"com.mitchellbosecke.benchmark.Handlebars","thrpt",1,4,58.077369,4.678936,"ops/ms"
"com.mitchellbosecke.benchmark.HtmlFlow","thrpt",1,4,390.565322,15.612564,"ops/ms"
"com.mitchellbosecke.benchmark.J2Html","thrpt",1,4,16.372078,0.027287,"ops/ms"
"com.mitchellbosecke.benchmark.JStachio","thrpt",1,4,311.098348,17.446912,"ops/ms"
"com.mitchellbosecke.benchmark.KotlinHtml","thrpt",1,4,27.739232,0.347632,"ops/ms"
"com.mitchellbosecke.benchmark.Mustache","thrpt",1,4,167.988570,2.228035,"ops/ms"
"com.mitchellbosecke.benchmark.Pebble","thrpt",1,4,132.422740,0.759311,"ops/ms"
"com.mitchellbosecke.benchmark.Rocker","thrpt",1,4,322.883409,35.807349,"ops/ms"
"com.mitchellbosecke.benchmark.Thymeleaf","thrpt",1,4,25.021445,0.100393,"ops/ms"
"com.mitchellbosecke.benchmark.Trimou","thrpt",1,4,152.789137,5.913811,"ops/ms"
"com.mitchellbosecke.benchmark.Velocity","thrpt",1,4,105.131005,3.787208,"ops/ms"
Loading

0 comments on commit 04b12b9

Please sign in to comment.