Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

mscdex
Copy link
Contributor

@mscdex mscdex commented Aug 5, 2019

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), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@mscdex mscdex added the benchmark Issues and PRs related to the benchmark subsystem. label Aug 5, 2019
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@mscdex mscdex added the wip Issues and PRs that are still a work in progress. label Aug 7, 2019
@mscdex mscdex force-pushed the benchmark-prof-feature branch from 6dcf3e9 to 4083bbc Compare August 7, 2019 05:30
@nodejs-github-bot
Copy link
Collaborator

@mscdex
Copy link
Contributor Author

mscdex commented Aug 7, 2019

@bnoordhuis @jasnell I've decided to generalize this because the ability to use other flags (e.g. --inspect) will be equally useful. Does this still LGTY?

@Trott
Copy link
Member

Trott commented Aug 7, 2019

Benchmark test run: https://ci.nodejs.org/job/node-test-commit-custom-suites-freestyle/8413/ (queued, will 404 until a worker is available)

@Trott Trott added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Aug 7, 2019
@@ -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(' '));
Copy link
Member

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.

@mscdex mscdex force-pushed the benchmark-prof-feature branch from 4083bbc to c0358a8 Compare August 7, 2019 13:56
@mscdex mscdex removed the wip Issues and PRs that are still a work in progress. label Aug 7, 2019
@nodejs-github-bot
Copy link
Collaborator

@mscdex mscdex changed the title benchmark: allow easier profiling of benchmarks benchmark: allow easy passing of process flags Aug 7, 2019
Trott pushed a commit to Trott/io.js that referenced this pull request Aug 8, 2019
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>
@Trott
Copy link
Member

Trott commented Aug 8, 2019

Landed in fd8d44f

@Trott Trott closed this Aug 8, 2019
@mscdex mscdex deleted the benchmark-prof-feature branch August 8, 2019 03:13
targos pushed a commit that referenced this pull request Aug 19, 2019
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. benchmark Issues and PRs related to the benchmark subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants