From 08a820a0af3f78747a751897046fedf9fb73c79c Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 13 Oct 2014 14:34:47 +1100 Subject: [PATCH] add versions to benchmark output --- benchmark/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/benchmark/index.js b/benchmark/index.js index 3f77972328..8ee43c7b69 100644 --- a/benchmark/index.js +++ b/benchmark/index.js @@ -76,6 +76,10 @@ var compilers = { } }; +_.each(compilers, function (compiler, name) { + compiler.title = name + " v" + require(name + "/package.json").version; +}); + _.each(fs.readdirSync(__dirname + "/fixtures"), function (name) { var alias = path.basename(name, path.extname(name)); @@ -93,13 +97,13 @@ _.each(fs.readdirSync(__dirname + "/fixtures"), function (name) { var kilo = (output.length / 1024).toFixed(2); console.log( matcha.utils.color(matcha.utils.padBefore(kilo + "KB", 22), "cyan"), - matcha.utils.color("» " + name, "gray") + matcha.utils.color("» " + compiler.title, "gray") ); }); }); _.each(compilers, function (compiler, name) { - bench(name, function () { + bench(compiler.title, function () { compiler.compile(code, loc); }); });