type-hinted hiccup
This commit is contained in:
parent
db3942f934
commit
27ab754387
|
@ -31,6 +31,13 @@ Units are in microseconds (us)
|
||||||
<td>24,000 us / 2900 us</td>
|
<td>24,000 us / 2900 us</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>hiccup (type-hinted)</td>
|
||||||
|
<td>0.335 us / 0.013 us</td>
|
||||||
|
<td>25 us / 0.431 us</td>
|
||||||
|
<td>498 us / 6.2 us</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>clabango (string)</td>
|
<td>clabango (string)</td>
|
||||||
<td>329 us / 5.7 us</td>
|
<td>329 us / 5.7 us</td>
|
||||||
|
|
|
@ -29,6 +29,13 @@
|
||||||
(hiccup/html [:ul (for [x (range 1 ceil)]
|
(hiccup/html [:ul (for [x (range 1 ceil)]
|
||||||
[:li x])]))
|
[:li x])]))
|
||||||
|
|
||||||
|
(defn simple-hiccup-hint []
|
||||||
|
(hiccup/html [:span {:class "foo"} ^String bar]))
|
||||||
|
|
||||||
|
(defn list-hiccup-hint [ceil]
|
||||||
|
(hiccup/html [:ul (for [x (range 1 ceil)]
|
||||||
|
[:li ^Number x])]))
|
||||||
|
|
||||||
|
|
||||||
(defn simple-clabango-no-fd []
|
(defn simple-clabango-no-fd []
|
||||||
(render (str "<span class=\"foo\">{{bar}}</span>") {:bar bar}))
|
(render (str "<span class=\"foo\">{{bar}}</span>") {:bar bar}))
|
||||||
|
@ -99,6 +106,14 @@
|
||||||
(with-progress-reporting (quick-bench (list-hiccup 1000)))
|
(with-progress-reporting (quick-bench (list-hiccup 1000)))
|
||||||
(println "\n --- \n")
|
(println "\n --- \n")
|
||||||
|
|
||||||
|
(println "\n\n ***** type-hinted hiccup benchmarks ***** \n\n")
|
||||||
|
(with-progress-reporting (quick-bench (simple-hiccup-hint)))
|
||||||
|
(println "\n --- \n")
|
||||||
|
(with-progress-reporting (quick-bench (list-hiccup-hint 50)))
|
||||||
|
(println "\n --- \n")
|
||||||
|
(with-progress-reporting (quick-bench (list-hiccup-hint 1000)))
|
||||||
|
(println "\n --- \n")
|
||||||
|
|
||||||
(println "\n\n ***** clabango string ***** \n\n")
|
(println "\n\n ***** clabango string ***** \n\n")
|
||||||
(quick-bench (simple-clabango-no-fd))
|
(quick-bench (simple-clabango-no-fd))
|
||||||
(println "\n --- \n")
|
(println "\n --- \n")
|
||||||
|
|
Reference in a new issue