0

I have created a test cases for comparing the performance of different template engines. Here my test case link : http://jsperf.com/dust-hogan-handlebar-ejs-underscore I've noticed Dust.js's performance and so surprise with that result. I have question : is my test case right? and if it's right, so with that result show that Dust's performance is the slowest with other template engines : hogan, underscore ... but with that thing why LinkedIn apply Dust template to their project because it's so slower than other template engines's performance . I'm so curious about that and thank very much your opinion for helping me this problem.

kate
  • 179
  • 2
  • 16

1 Answers1

0

I was very surprised with that result too. The problem is in compiling the templates on every single test. In a well coded javascript browser app, this would never happen as production templates should be precompiled as part of a build script.

If you refactor your tests to compile the templates for each template library in the test setup section, you should find Dust has much better performance and may even top the charts.

Also, in the underscore test, you're rendering the template twice on each test run.

Simon
  • 1,756
  • 12
  • 8
  • thank you for your answer, (although I waited so long to get the answer at here ), btw now i decide using dust for my project. :D – kate Oct 07 '13 at 10:22