Hi All ,
These past days i was looking for a flexible and fast template engine for my recent projects with nodejs and i had serious problems for choosing the best .
I looked all the internet for good benchmark game and read many reviews for days and at last i find out many these reviews and benchmarks are old and unreliable .
one of the best benchmarks was : https://github.com/baryshev/template-benchmark but it wasn't updated for about 2 years and benchmarks used outdated template engines .
so i decide to make my own benchmark game and find the best by my self .
i used latest libraries from npm in my packages.json :
"dependencies": {
"ect": "x",
"ejs": "x",
"eco": "x",
"swig": "x",
"jade": "x",
"hogan.js": "x",
"dustjs-linkedin": "x",
"fest": "x",
"dot": "x",
"handlebars": "x",
"coffeekup": "x",
"underscore": "x",
"gaikan": "x"
}
ok so i start benchmark for process of 200000 requests in both unescaped and escaped input conditions and here is the result :
Escaped Rankings :
1. ECT : 2284
2. Fest : 2475
3. Hogan.js : 2707
4. Handlebars.js : 2834
5. Dust : 3181
6. Underscore : 3286
7. EJS without `with` : 3523
8. doT : 3536
9. CoffeeKup : 3617
10. Jade without `with` : 3807
11. Swig : 4999
12. EJS : 5578
13. Jade : 5908
14. Eco : 8702
Unescaped Rankings :
1. doT : 87
2. ECT : 127
3. Fest : 287
4. EJS without `with` : 370
5. Swig : 448
6. Handlebars.js : 463
7. Hogan.js : 607
8. Eco : 855
9. Jade without `with` : 857
10. Dust : 902
11. EJS : 1771
12. Underscore : 2341
13. Jade : 2855
14. CoffeeKup : 6698
Total Rankings ( unescaped + escaped ) :
1. ECT : 2411
2. Fest : 2762
3. Handlebars.js : 3297
4. Hogan.js : 3314
5. doT : 3623
6. EJS without `with` : 3893
7. Dust : 4083
8. Jade without `with` : 4664
9. Swig : 5447
10. Underscore : 5627
11. EJS : 7349
12. Jade : 8763
13. Eco : 9557
14. CoffeeKup : 10315
as you can see it's look ect win this game in total .
It's very nice to see jade improved performance in these years ( about 3x better ) but it's still too slow .
I really like jade templating idea and it's so comfortable and pleasant but at last i find out i can't sacrifice performance for ease of my self .
I checked other templating engines in both performance and usability aspects and my personal choice is ECT for sure . it's fast and also has simple and flexible syntax .
I will be glad if you share your comments about this benchmark with me and tell me what template engine is your choice .
Have A Nice Day !