Comparing version 0.3.4 to 0.3.5
@@ -19,2 +19,4 @@ #!/usr/bin/env node | ||
var fnBind = fn.bind(o, 1, 2, 3) | ||
function method () { | ||
@@ -29,5 +31,6 @@ o.method(1,2,3); | ||
, "fn.call()" : fnCall | ||
, "method()" : method | ||
, "o.method()" : method | ||
, "fn.bind()" : fnBind | ||
}; | ||
require("../").runMain() |
@@ -11,2 +11,11 @@ | ||
var nt_ = typeof setImmediate === 'function' ? setImmediate : process.nextTick | ||
var ntN = 0 | ||
function nt(fn) { | ||
if (ntN++ < 100) | ||
return process.nextTick(fn) | ||
nt_(fn) | ||
ntN = 0 | ||
} | ||
function runMain () { | ||
@@ -52,3 +61,3 @@ var test = require.main.exports | ||
if (Date.now() > stopTime) return done() | ||
process.nextTick(runner) | ||
nt(runner) | ||
} | ||
@@ -96,3 +105,3 @@ function done () { | ||
} else { | ||
process.nextTick(function () { comparer(currentCompare+1) }) | ||
nt(function () { comparer(currentCompare+1) }) | ||
} | ||
@@ -103,3 +112,5 @@ })(0) | ||
for (var i = 0; i < testCount; i ++) { | ||
ret[ tests[i].name ] = results[i] | ||
// throw out the first item in each list, since it's usually | ||
// a vm warm-up anyway, and not a valid run. | ||
ret[ tests[i].name ] = results[i].slice(1) | ||
} | ||
@@ -160,2 +171,12 @@ cb(null, ret) | ||
(oom(winner.avg, second.avg)+" order(s) of magnitude faster") | ||
if (pct(winner.avg, second.avg) < 2) print | ||
("BASICALLY THE SAME") | ||
else if (times(winner.avg, second.avg) < 2) print | ||
("A LITTLE FASTER") | ||
else if (oom(winner.avg, second.avg) < 1) print | ||
("QUITE A BIT FASTER") | ||
else print | ||
("A LOT FASTER") | ||
if (loser) print | ||
@@ -162,0 +183,0 @@ ("\nCompared with the slowest ("+loser.name+"), it's:") |
@@ -1,7 +0,10 @@ | ||
{ "name" : "bench" | ||
, "version" : "0.3.4" | ||
, "description" : "A little utility for doing side-by-side benchmarks in nodejs" | ||
, "author" : "Isaac Z. Schlueter <i@izs.me>" | ||
, "bin" : { "node-bench" : "./lib/cli-wrapper.js" } | ||
, "main" : "lib/bench.js" | ||
{ | ||
"name": "bench", | ||
"version": "0.3.5", | ||
"description": "A little utility for doing side-by-side benchmarks in nodejs", | ||
"author": "Isaac Z. Schlueter <i@izs.me>", | ||
"bin": { | ||
"node-bench": "./lib/cli-wrapper.js" | ||
}, | ||
"main": "lib/bench.js" | ||
} |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
598847
1061
2435
1