Browse Source

bench: Add flag to be silent in runner

This is helpful in tracking down bailouts and deopts in Stream classes,
without triggering one from the string write in console.log
v0.9.12-release
isaacs 12 years ago
parent
commit
e4383c0170
  1. 2
      benchmark/common.js

2
benchmark/common.js

@ -1,5 +1,6 @@
var assert = require('assert'); var assert = require('assert');
var path = require('path'); var path = require('path');
var silent = +process.env.NODE_BENCH_SILENT;
exports.PORT = process.env.PORT || 12346; exports.PORT = process.env.PORT || 12346;
@ -184,6 +185,7 @@ Benchmark.prototype.end = function(operations) {
Benchmark.prototype.report = function(value) { Benchmark.prototype.report = function(value) {
var heading = this.getHeading(); var heading = this.getHeading();
if (!silent)
console.log('%s: %s', heading, value.toPrecision(5)); console.log('%s: %s', heading, value.toPrecision(5));
process.exit(0); process.exit(0);
}; };

Loading…
Cancel
Save