2013-01-30 02:25:33 -05:00
|
|
|
# clojure-template-benchmarks
|
|
|
|
|
2013-01-30 02:30:18 -05:00
|
|
|
I decided to do some decent Clojure templating benchmarks:
|
2013-01-30 02:25:33 -05:00
|
|
|
|
2013-01-30 02:35:36 -05:00
|
|
|
Test results are avg / standard deviation.
|
2013-01-30 02:25:33 -05:00
|
|
|
|
2013-01-30 02:35:36 -05:00
|
|
|
## Data
|
2013-01-30 02:30:18 -05:00
|
|
|
<table>
|
2013-01-30 02:25:33 -05:00
|
|
|
|
2013-01-30 02:30:18 -05:00
|
|
|
<tr>
|
|
|
|
<th>Template Engine</th>
|
|
|
|
<th>Simple Data Injection</th>
|
2013-01-30 02:35:36 -05:00
|
|
|
<th>Small List (50 items)</th>
|
|
|
|
<th>Big List (1000 items)</th>
|
2013-01-30 02:30:18 -05:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>str</td>
|
2013-01-30 02:35:36 -05:00
|
|
|
<td>165 ns / 16 ns</td>
|
|
|
|
<td>14 us / 253 ns</td>
|
|
|
|
<td>273 us / 14 us</td>
|
2013-01-30 02:30:18 -05:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>hiccup</td>
|
2013-01-30 02:35:36 -05:00
|
|
|
<td>20 us / 367 ns</td>
|
|
|
|
<td>1.1 ms / 59 us</td>
|
|
|
|
<td>24 ms / 2.9 ms</td>
|
2013-01-30 02:30:18 -05:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>clabango (string)</td>
|
2013-01-30 02:35:36 -05:00
|
|
|
<td>329 us / 5.7 us</td>
|
|
|
|
<td>1.8 ms / 146 us</td>
|
|
|
|
<td>20.6 us / 799 us</td>
|
2013-01-30 02:30:18 -05:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>clabango (files)</td>
|
2013-01-30 02:35:36 -05:00
|
|
|
<td>478 us / 42 us</td>
|
|
|
|
<td>1.79 ms / 52 us</td>
|
|
|
|
<td>19.9 ms / 573 us</td>
|
2013-01-30 02:30:18 -05:00
|
|
|
</tr>
|
2013-01-30 02:25:33 -05:00
|
|
|
|
2013-01-30 02:30:18 -05:00
|
|
|
</table>
|
|
|
|
|
2013-01-30 02:35:36 -05:00
|
|
|
## Conclusions
|
2013-01-30 02:30:18 -05:00
|
|
|
|
2013-01-30 02:37:14 -05:00
|
|
|
+ str is really fast and a huge waste of programmer time.
|
|
|
|
+ clabango from filesystem templates or string literals are equivalent
|
|
|
|
+ clabango and hiccup are equivalent in performance
|
2013-01-30 02:30:18 -05:00
|
|
|
|
|
|
|
Copyright © 2013 bitemyapp
|