-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
benchmark: allow easy passing of process flags #28986
Conversation
6dcf3e9
to
4083bbc
Compare
@bnoordhuis @jasnell I've decided to generalize this because the ability to use other flags (e.g. |
Benchmark test run: https://ci.nodejs.org/job/node-test-commit-custom-suites-freestyle/8413/ (queued, will 404 until a worker is available) |
benchmark/common.js
Outdated
@@ -25,6 +25,8 @@ function Benchmark(fn, configs, options) { | |||
if (options && options.flags) { | |||
this.flags = this.flags.concat(options.flags); | |||
} | |||
if (process.env.NODE_BENCHMARK_FLAGS) | |||
this.flags = this.flags.concat(process.env.NODE_BENCHMARK_FLAGS.split(' ')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe split on /\s+/
? Otherwise env NODE_BENCHMARK_FLAGS="--foo --bar" node bench.js
(note the double space) produces three flags, one of them the empty string.
4083bbc
to
c0358a8
Compare
PR-URL: nodejs#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>
Landed in fd8d44f |
PR-URL: #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>
Without this, using
--prof
when running benchmarks also produces separate profiler output for the benchmark runner itself, which is generally not helpful. With this change, it's quick and easy to know which profiler output file to look at.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes