summaryrefslogtreecommitdiff
path: root/benchmark
diff options
context:
space:
mode:
authorBrian White <mscdex@mscdex.net>2019-08-05 19:51:18 -0400
committerRich Trott <rtrott@gmail.com>2019-08-07 19:33:17 -0700
commitfd8d44f644798ed20bf950d1ff7982eba6cce0a7 (patch)
tree04297b36dfaaa33a5c35fa1184851bf257d17f9e /benchmark
parentc072a807178230948ed40dea0708593663efa0cd (diff)
downloadandroid-node-v8-fd8d44f644798ed20bf950d1ff7982eba6cce0a7.tar.gz
android-node-v8-fd8d44f644798ed20bf950d1ff7982eba6cce0a7.tar.bz2
android-node-v8-fd8d44f644798ed20bf950d1ff7982eba6cce0a7.zip
benchmark: allow easy passing of process flags
PR-URL: https://github.com/nodejs/node/pull/28986 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/common.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/benchmark/common.js b/benchmark/common.js
index b4778d7193..6a3be4fc37 100644
--- a/benchmark/common.js
+++ b/benchmark/common.js
@@ -25,6 +25,10 @@ function Benchmark(fn, configs, options) {
if (options && options.flags) {
this.flags = this.flags.concat(options.flags);
}
+ if (process.env.NODE_BENCHMARK_FLAGS) {
+ const flags = process.env.NODE_BENCHMARK_FLAGS.split(/\s+/);
+ this.flags = this.flags.concat(flags);
+ }
// Holds process.hrtime value
this._time = [0, 0];
// Used to make sure a benchmark only start a timer once