Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
benchmark: correct typo of enqueueConfigs function in benchmark common
  • Loading branch information
BeniCheni committed Mar 20, 2019
commit 7e802abfc500174f44359b37c3087bab3392797b
4 changes: 2 additions & 2 deletions benchmark/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function Benchmark(fn, configs, options) {
}
};

const enqueuConfigs = (configs) => {
const enqueueConfigs = (configs) => {
// Parse job-specific configuration from the command line arguments
const parsed_args = this._parseArgs(process.argv.slice(2), configs);
this.options = parsed_args.cli;
Expand All @@ -52,7 +52,7 @@ function Benchmark(fn, configs, options) {
enqueueConfigsInGroups(configs);
}
} else {
enqueuConfigs(configs);
enqueueConfigs(configs);
}
Copy link
Copy Markdown
Member

@lundibundi lundibundi Feb 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be simplified to

const parseConfig = (config) => {
  const parsedArgs = this._parseArgs(process.argv.slice(2), config);
  this.options = parsedArgs.cli;
  this.extra_options = parsedArgs.extra;
  this.queue = [ ...this.queue, ...this._queue(this.options) ];
}

if (byGroup) {
  let usedConfigs = Object.values(configs);
  if (process.env.NODEJS_BENCHMARK_BYPASS_GROUP)
    usedConfigs = usedConfigs[0];
  usedConfigs.forEach(parseConfig);
} else {
  parseConfig(configs);
}


// The configuration of the current job, head of the queue
Expand Down