Skip to content

Commit

Permalink
Refactor benchmark for new variable support
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Oct 2, 2014
1 parent 9730087 commit 79d0acc
Showing 1 changed file with 25 additions and 20 deletions.
45 changes: 25 additions & 20 deletions benchmark/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,31 +47,36 @@ function forEveryLanguage(callback) {
}
}

suite('benchmarks * 82 paragraphs in different languages', function () {
set('iterations', 30);
set('type', 'static');
suite(
'benchmarks * ' +
Object.keys(fixtures).length +
' paragraphs in different languages',
function () {
set('iterations', 10);
set('type', 'static');

bench('franc -- this module', function () {
forEveryLanguage(function (language, fixture) {
franc(fixture);
bench('franc -- this module', function () {
forEveryLanguage(function (language, fixture) {
franc(fixture);
});
});
});

bench('guesslanguage', function () {
forEveryLanguage(function (language, fixture) {
guessLanguage(fixture);
bench('guesslanguage', function () {
forEveryLanguage(function (language, fixture) {
guessLanguage(fixture);
});
});
});

bench('languagedetect', function () {
forEveryLanguage(function (language, fixture) {
languageDetect(fixture);
bench('languagedetect', function () {
forEveryLanguage(function (language, fixture) {
languageDetect(fixture);
});
});
});

bench('vac', function () {
forEveryLanguage(function (language, fixture) {
vac(fixture);
bench('vac', function () {
forEveryLanguage(function (language, fixture) {
vac(fixture);
});
});
});
});
}
);

0 comments on commit 79d0acc

Please sign in to comment.