Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove outdated eco package from bench
The `eco`-templates (Embedded CoffeeScript templates)
had their last update over 10 years ago, so we can
remove this dependency from our benchmark.
  • Loading branch information
jaylinski committed Jan 1, 2022
1 parent f73be4e commit 0896d00
Show file tree
Hide file tree
Showing 13 changed files with 7 additions and 118 deletions.
62 changes: 0 additions & 62 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Expand Up @@ -40,7 +40,6 @@
"concurrently": "^5.0.0",
"dirty-chai": "^2.0.1",
"dustjs-linkedin": "^2.0.2",
"eco": "~1.1.0-rc-3",
"eslint": "^6.7.2",
"eslint-config-prettier": "^6.7.0",
"eslint-plugin-compat": "^3.13.0",
Expand Down
3 changes: 1 addition & 2 deletions tests/bench/templates/array-each.js
Expand Up @@ -9,6 +9,5 @@ module.exports = {
},
handlebars: '{{#each names}}{{name}}{{/each}}',
dust: '{#names}{name}{/names}',
mustache: '{{#names}}{{name}}{{/names}}',
eco: '<% for item in @names: %><%= item.name %><% end %>'
mustache: '{{#names}}{{name}}{{/names}}'
};
14 changes: 0 additions & 14 deletions tests/bench/templates/complex.eco

This file was deleted.

1 change: 0 additions & 1 deletion tests/bench/templates/complex.js
Expand Up @@ -15,6 +15,5 @@ module.exports = {

handlebars: fs.readFileSync(__dirname + '/complex.handlebars').toString(),
dust: fs.readFileSync(__dirname + '/complex.dust').toString(),
eco: fs.readFileSync(__dirname + '/complex.eco').toString(),
mustache: fs.readFileSync(__dirname + '/complex.mustache').toString()
};
3 changes: 1 addition & 2 deletions tests/bench/templates/depth-1.js
Expand Up @@ -9,6 +9,5 @@ module.exports = {
foo: 'bar'
},
handlebars: '{{#each names}}{{../foo}}{{/each}}',
mustache: '{{#names}}{{foo}}{{/names}}',
eco: '<% for item in @names: %><%= @foo %><% end %>'
mustache: '{{#names}}{{foo}}{{/names}}'
};
4 changes: 1 addition & 3 deletions tests/bench/templates/depth-2.js
Expand Up @@ -10,7 +10,5 @@ module.exports = {
},
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 %>'
mustache: '{{#names}}{{#name}}{{bat}}{{foo}}{{/name}}{{/names}}'
};
1 change: 0 additions & 1 deletion tests/bench/templates/object.js
Expand Up @@ -2,6 +2,5 @@ module.exports = {
context: { person: { name: 'Larry', age: 45 } },
handlebars: '{{#with person}}{{name}}{{age}}{{/with}}',
dust: '{#person}{name}{age}{/person}',
eco: '<%= @person.name %><%= @person.age %>',
mustache: '{{#person}}{{name}}{{age}}{{/person}}'
};
2 changes: 0 additions & 2 deletions tests/bench/templates/paths.js
Expand Up @@ -3,7 +3,5 @@ module.exports = {
handlebars:
'{{person.name.bar.baz}}{{person.age}}{{person.foo}}{{animal.age}}',
dust: '{person.name.bar.baz}{person.age}{person.foo}{animal.age}',
eco:
'<%= @person.name.bar.baz %><%= @person.age %><%= @person.foo %><% if @animal: %><%= @animal.age %><% end %>',
mustache: '{{person.name.bar.baz}}{{person.age}}{{person.foo}}{{animal.age}}'
};
3 changes: 1 addition & 2 deletions tests/bench/templates/string.js
Expand Up @@ -2,6 +2,5 @@ module.exports = {
context: {},
handlebars: 'Hello world',
dust: 'Hello world',
mustache: 'Hello world',
eco: 'Hello world'
mustache: 'Hello world'
};
3 changes: 1 addition & 2 deletions tests/bench/templates/subexpression.js
Expand Up @@ -7,8 +7,7 @@ module.exports = {
return 'Colors';
}
},
handlebars: '{{echo (header)}}',
eco: '<%= @echo(@header()) %>'
handlebars: '{{echo (header)}}'
};

module.exports.context = module.exports.helpers;
3 changes: 1 addition & 2 deletions tests/bench/templates/variables.js
Expand Up @@ -2,6 +2,5 @@ module.exports = {
context: { name: 'Mick', count: 30 },
handlebars: 'Hello {{name}}! You have {{count}} new messages.',
dust: 'Hello {name}! You have {count} new messages.',
mustache: 'Hello {{name}}! You have {{count}} new messages.',
eco: 'Hello <%= @name %>! You have <%= @count %> new messages.'
mustache: 'Hello {{name}}! You have {{count}} new messages.'
};
25 changes: 1 addition & 24 deletions tests/bench/throughput.js
@@ -1,6 +1,5 @@
var _ = require('underscore'),
runner = require('./util/template-runner'),
eco,
dust,
Handlebars,
Mustache;
Expand All @@ -17,12 +16,6 @@ try {
/* NOP */
}

try {
eco = require('eco');
} catch (err) {
/* NOP */
}

function error() {
throw new Error('EWOT');
}
Expand All @@ -35,7 +28,6 @@ function makeSuite(bench, name, template, handlebarsOnly) {
handlebarsOut,
compatOut,
dustOut,
ecoOut,
mustacheOut;

var handlebar = Handlebars.compile(template.handlebars, { data: false }),
Expand Down Expand Up @@ -85,20 +77,6 @@ function makeSuite(bench, name, template, handlebarsOnly) {
}
}

if (eco) {
if (template.eco) {
var ecoTemplate = eco.compile(template.eco);

ecoOut = ecoTemplate(context);

bench('eco', function() {
ecoTemplate(context);
});
} else {
bench('eco', error);
}
}

if (Mustache) {
var mustacheSource = template.mustache,
mustachePartials = partials && partials.mustache;
Expand Down Expand Up @@ -139,12 +117,11 @@ function makeSuite(bench, name, template, handlebarsOnly) {

compare(compatOut, 'compat');
compare(dustOut, 'dust');
compare(ecoOut, 'eco');
compare(mustacheOut, 'mustache');
}

module.exports = function(grunt, callback) {
// Deferring load incase we are being run inline with the grunt build
// Deferring load in case we are being run inline with the grunt build
Handlebars = require('../../lib');

console.log('Execution Throughput');
Expand Down

0 comments on commit 0896d00

Please sign in to comment.