From 10e861c45f520d18ba86b70b3111bc6185a77fc1 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Mon, 5 Feb 2018 19:49:50 +0100 Subject: [PATCH] benchmark: improve compare output The current output uses JSON.stringify to escape the config values. This switches to util.inspect to have a better readable output. PR-URL: https://github.com/nodejs/node/pull/18597 Reviewed-By: James M Snell Reviewed-By: Anatoli Papirovski Reviewed-By: Andreas Madsen Reviewed-By: Luigi Pinca --- benchmark/compare.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/benchmark/compare.js b/benchmark/compare.js index 6b51a70eb9a41b..e7866b60e36418 100644 --- a/benchmark/compare.js +++ b/benchmark/compare.js @@ -1,6 +1,7 @@ 'use strict'; -const fork = require('child_process').fork; +const { fork } = require('child_process'); +const { inspect } = require('util'); const path = require('path'); const CLI = require('./_cli.js'); const BenchmarkProgress = require('./_benchmark_progress.js'); @@ -76,7 +77,7 @@ if (showProgress) { // Construct configuration string, " A=a, B=b, ..." let conf = ''; for (const key of Object.keys(data.conf)) { - conf += ` ${key}=${JSON.stringify(data.conf[key])}`; + conf += ` ${key}=${inspect(data.conf[key])}`; } conf = conf.slice(1); // Escape quotes (") for correct csv formatting