Node Template Engine Benchmarks

Fork me on GitHub! Feel awesome!

These benchmarks should be taken very lightly. While, benchmarking is a good indication of one engine versus another, this doesn't show that, in reality, all of these template engines are very fast.

As a good rule, if your templating engine is your bottleneck, you shouldn't be using a templating engine.

Overall

Compile and Render Benchmark Scores (bigger is better). Run on a 2.93 GHz Intel Core i7 iMac with 12GB RAM.
Engine (npm name) Average (mean) Scores (bigger is better)
swig 106.23 111.02 104.62 106.65 103.77 107.21 107.61 105.95 101.54 107.66
jqtpl 39.44 40.28 40.04 38.79 40.03 38.51 40.43 38.60 38.55 39.70
whiskers 31.43 31.48 31.71 30.97 31.55 32.02 32.32 30.74 30.69 31.40
ejs 14.22 14.55 14.41 14.05 14.38 14.18 14.18 14.17 14.23 13.85
hamljs 5.55 5.47 5.54 5.54 5.57 5.65 5.65 5.51 5.51 5.49
jade 4.03 3.89 4.03 4.06 3.97 4.12 4.10 4.01 4.07 4.04
mu2 3.24 3.14 3.30 3.31 3.26 3.17 3.28 3.26 3.21 3.23
haml 1.94 1.99 1.97 1.98 1.95 1.94 1.93 1.88 1.89 1.89
templ8 1.66 1.63 1.67 1.66 1.66 1.70 1.70 1.68 1.65 1.61
coffeekup 0.80 0.77 0.80 0.81 0.80 0.80 0.81 0.82 0.78 0.78
Fastest Versus % Faster Times Faster Order of Magnitude Faster
swig complete jqtpl 62.87% 2.69 0.43
coffeekup 99.25% 132.53 2.12

Compile Step

Compile-Only* Benchmark Scores (bigger is better). Run on a 2.93 GHz Intel Core i7 iMac with 12GB RAM.
Engine (npm name) Average (mean) Scores (bigger is better)
jqtpl 649.94 639.22 634.30 669.27 664.76 652.15 647.11 647.25 668.13 627.26
swig 605.57 618.64 579.60 623.79 630.16 599.51 599.52 595.87 597.47 605.59
whiskers 37.68 37.88 38.12 37.71 38.67 38.09 37.61 36.96 36.49 37.61
ejs 19.64 19.51 19.56 20.26 19.75 20.14 19.84 18.80 19.45 19.46
hamljs 6.11 6.38 6.48 6.49 5.99 6.16 5.98 5.40 6.05 6.09
jade 5.01 4.96 5.20 5.05 5.03 5.04 4.95 4.81 5.05 5.02
mu2 3.77 3.80 3.85 3.62 3.90 3.93 3.63 3.79 3.69 3.71
haml 2.04 2.03 2.12 2.09 2.02 2.07 2.07 2.03 1.97 1.92
templ8 1.90 1.90 1.89 1.97 1.93 1.90 1.93 1.79 1.92 1.88
coffeekup 0.87 0.87 0.89 0.87 0.86 0.87 0.88 0.87 0.86 0.88
Fastest Versus % Faster Times Faster Order of Magnitude Faster
jqtpl compile swig 6.83% 1.07 0.03
coffeekup 99.87% 740.91 2.87

Render Step

Render-Only Benchmark Scores (bigger is better). Run on a 2.93 GHz Intel Core i7 iMac with 12GB RAM.
Engine (npm name) Average (mean) Scores (bigger is better)
whiskers 263.25 263.65 265.58 259.86 262.45 267.25 263.00 262.90 262.96 261.63
swig 120.26 121.07 117.53 117.49 118.75 121.85 119.18 120.53 122.23 123.73
haml 89.48 90.08 87.65 89.85 89.45 90.80 89.02 87.91 90.63 89.95
ejs 76.57 71.03 76.44 75.94 78.86 78.56 77.49 77.19 76.70 76.94
hamljs 59.05 58.16 57.79 58.58 60.12 59.53 59.53 58.97 59.10 59.65
jqtpl 41.77 42.09 40.27 40.67 40.27 42.81 42.09 42.25 42.51 42.95
mu2 37.32 36.82 36.64 36.60 37.85 37.51 38.06 37.19 37.54 37.64
jade 25.39 25.65 25.50 25.50 25.09 24.89 25.33 25.37 25.47 25.67
coffeekup 18.84 18.99 18.85 18.23 18.97 18.92 18.89 18.81 18.95 18.92
templ8 15.78 15.09 15.31 15.74 16.03 15.76 15.99 16.08 16.06 15.93
Fastest Versus % Faster Times Faster Order of Magnitude Faster
whiskers render swig 54.32% 2.19 0.34
templ8 94% 16.68 1.22

To calculate these benchmarks on your own system, clone this repository and run node index.js from your command-line.