Skip to content

Pefromance notes

Alexander Tsybulsky edited this page Jan 31, 2017 · 2 revisions

Performance notes

The package contain zmustache_perf_test include which runs a short performace test - it renders the following template 10 times. The data set contains 1000 items 4 sizes each.

Welcome to {{shop}}
Our sales:
{{#items}}
* {{name}} - ${{price}}
  sizes: {{#sizes}}{{size}}[{{qty}}pc], {{/sizes}}
{{/items}}

Here are the results (hardware: Xeon E3-1245 3.40GHz). It varies from run to run without code change. Mostly it outputs 2-3 typical cases of figures. I don't know why :)

Some times this:
Perf test results itab:   0.879498 sec / 10 x 1000 iterations
Perf test results unitab: 1.055556 sec / 10 x 1000 iterations

Some times that:
Perf test results itab:   1.364575 sec / 10 x 1000 iterations
Perf test results unitab: 1.586002 sec / 10 x 1000 iterations

In my opinion it leaves a space for improvement. In particular, the same test suite executed on my Macbook Air (Core i5 1.6GHz UV) with mustache.js takes 143 - 172 ms (also varies from run to run ?!).

At the moment I'm not sure about the direction of optimization - more real usage statistics needs to be collected. So please log an issue with case details if you experience performance problems. And, of course, if you see what can be improved - that is much welcomed :)

Clone this wiki locally