From e4383c0170832368564bd39ddc5dba6e104eb1b2 Mon Sep 17 00:00:00 2001 From: isaacs Date: Sun, 3 Mar 2013 15:44:36 -0800 Subject: [PATCH] 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 --- benchmark/common.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/benchmark/common.js b/benchmark/common.js index 3c478bd0199..bfbb054875b 100644 --- a/benchmark/common.js +++ b/benchmark/common.js @@ -1,5 +1,6 @@ var assert = require('assert'); var path = require('path'); +var silent = +process.env.NODE_BENCH_SILENT; exports.PORT = process.env.PORT || 12346; @@ -184,7 +185,8 @@ Benchmark.prototype.end = function(operations) { Benchmark.prototype.report = function(value) { var heading = this.getHeading(); - console.log('%s: %s', heading, value.toPrecision(5)); + if (!silent) + console.log('%s: %s', heading, value.toPrecision(5)); process.exit(0); };