Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Needed proper benchmarking of frontend views
Clojure
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
doc
src/clojure_template_benchmarks
test/clojure_template_benchmarks
.gitignore
README.md
project.clj

README.md

clojure-template-benchmarks

I decided to do some decent Clojure templating benchmarks:

Test results are avg / standard deviation.

Data

The unit 'us' is microseconds. Typical bullshit "ran this on my macbook" arrangement. Run it on your own thing if you care.

Template Engine Simple Data Injection Small List (50 items) Big List (1000 items)
str 0.365 us / 0.002 us 29 us / 0.220 us 572 us / 2 us
hiccup 0.673 us / 0.006 us 35 us / 1 us 682 us / 3 us
hiccup (type-hinted) Identical to or slower than non-type-hinted hiccup.
clabango (string) 544 us / 6.7 us 2452 us / 17 us 30,000 us / 193 us
clabango (files) 665 us / 8.7 us 2,617 us / 22 us 30,450 us / 390 us
stencil (string) 90 us / 0.5 us 290 us / 2.7 us 1,300 us / 13 us
stencil (file) 2.2 us / 0.019 us 58 us / 0.465 us 1,148 us / 10 us
mustache.clj (file) 0.947 us / 0.006 us 26 us / 0.206 us 541 us / 4.7 us
tinsel 0.678 us / 0.006 us 34 us / 0.175 us 679 us / 7.1 us
laser 404 us / 9.4 us 3,770 us / 26 us 68,000 us / 925 us
laser (type-hinted) 401 us / 3.1 us 3,764 us / 18 us 69,408 us / 1,028 us
enlive 47 us / 0.397 us 385 us / 8.5 us 6,800 us / 51 us

Conclusions

  • (str ...), Mustache.clj, Tinsel, and Hiccup are all fast.
  • Raynes refactored huge parts of Laser and will probably look into improving performance.
  • Enlive hasn't changed at all.
  • Stencil seems less impressive than it used to, but it's still faster than most options.
  • Clabango has gotten worse.

Copyright © 2013 bitemyapp

Something went wrong with that request. Please try again.