summaryrefslogtreecommitdiffstats
path: root/bench
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2014-08-13 20:46:07 -0500
committerkpdecker <kpdecker@gmail.com>2014-08-13 20:46:42 -0500
commitc98613b711a70a82a960c20c00d8d92d5eed1024 (patch)
tree364862d90bc601284d35f5c19e8fed1abad7e4f4 /bench
parent625b00e1dafccc8653bf4cb4dc3dac55f6b3b020 (diff)
downloadhandlebars.js-c98613b711a70a82a960c20c00d8d92d5eed1024.zip
handlebars.js-c98613b711a70a82a960c20c00d8d92d5eed1024.tar.gz
handlebars.js-c98613b711a70a82a960c20c00d8d92d5eed1024.tar.bz2
Implement recursive field lookup in compat mode
Provides the mustache behavior of recursive lookup without the use of depthed paths. Note that this does incur a fairly dramatic performance penalty for depthed queries.
Diffstat (limited to 'bench')
-rw-r--r--bench/throughput.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/bench/throughput.js b/bench/throughput.js
index 308446a..d27a94d 100644
--- a/bench/throughput.js
+++ b/bench/throughput.js
@@ -28,11 +28,13 @@ function makeSuite(bench, name, template, handlebarsOnly) {
partials = template.partials,
handlebarsOut,
+ compatOut,
dustOut,
ecoOut,
mustacheOut;
var handlebar = Handlebars.compile(template.handlebars, {data: false}),
+ compat = Handlebars.compile(template.handlebars, {data: false, compat: true}),
options = {helpers: template.helpers};
_.each(template.partials && template.partials.handlebars, function(partial, name) {
Handlebars.registerPartial(name, Handlebars.compile(partial, {data: false}));
@@ -43,6 +45,11 @@ function makeSuite(bench, name, template, handlebarsOnly) {
handlebar(context, options);
});
+ compatOut = compat(context, options);
+ bench("compat", function() {
+ compat(context, options);
+ });
+
if (handlebarsOnly) {
return;
}
@@ -107,6 +114,7 @@ function makeSuite(bench, name, template, handlebarsOnly) {
}
}
+ compare(compatOut, 'compat');
compare(dustOut, 'dust');
compare(ecoOut, 'eco');
compare(mustacheOut, 'mustache');