From 6ca06d41156a43d29790d101d6aa97ed922ca8ad Mon Sep 17 00:00:00 2001 From: kpdecker Date: Thu, 6 Feb 2014 22:50:12 -0800 Subject: [PATCH] Add depth benchmark cases --- bench/templates/depth-1.js | 6 ++++++ bench/templates/depth-2.js | 6 ++++++ 2 files changed, 12 insertions(+) create mode 100644 bench/templates/depth-1.js create mode 100644 bench/templates/depth-2.js diff --git a/bench/templates/depth-1.js b/bench/templates/depth-1.js new file mode 100644 index 000000000..74809bca8 --- /dev/null +++ b/bench/templates/depth-1.js @@ -0,0 +1,6 @@ +module.exports = { + context: { names: [{name: "Moe"}, {name: "Larry"}, {name: "Curly"}, {name: "Shemp"}], foo: 'bar' }, + handlebars: "{{#each names}}{{../foo}}{{/each}}", + mustache: "{{#names}}{{foo}}{{/names}}", + eco: "<% for item in @names: %><%= @foo %><% end %>" +}; diff --git a/bench/templates/depth-2.js b/bench/templates/depth-2.js new file mode 100644 index 000000000..1d38baa4e --- /dev/null +++ b/bench/templates/depth-2.js @@ -0,0 +1,6 @@ +module.exports = { + context: { names: [{bat: 'foo', name: ["Moe"]}, {bat: 'foo', name: ["Larry"]}, {bat: 'foo', name: ["Curly"]}, {bat: 'foo', name: ["Shemp"]}], foo: 'bar' }, + handlebars: "{{#each names}}{{#each name}}{{../bat}}{{../../foo}}{{/each}}{{/each}}", + mustache: "{{#names}}{{#name}}{{bat}}{{foo}}{{/name}}{{/names}}", + eco: "<% for item in @names: %><% for child in item.name: %><%= item.bat %><%= @foo %><% end %><% end %>" +};