Skip to content

Commit

Permalink
Convert benchmarks to matcha
Browse files Browse the repository at this point in the history
  • Loading branch information
SBoudrias committed Dec 30, 2013
1 parent a4d8186 commit 3d8cfbb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
22 changes: 2 additions & 20 deletions benchmark/env.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,8 @@
'use strict';
var generators = require('..');
var Benchmark = require('benchmark');
var chalk = require('chalk');
var table = require('text-table');

var suite = new Benchmark.Suite();

suite
.add('Env#lookup', function () {
suite('Env', function () {
bench('#lookup()', function () {
generators().lookup();
});

suite.on('complete', function (e) {
var tests = e.currentTarget;
var nbr = tests.length;
var t = [
['test', 'ops/sec']
];
while (nbr--) {
t.push([tests[nbr].name, tests[nbr].hz]);
}
console.log(table(t));
});

suite.run({ async: true });
8 changes: 8 additions & 0 deletions benchmark/module.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict';

suite('yeoman-generator module', function () {
bench('require', function () {
require('..');
delete require.cache[require.resolve('..')];
});
});

0 comments on commit 3d8cfbb

Please sign in to comment.