Skip to content

Update benchmark.js test file in order to reduce the time `test-benchmark-buffer` test takes to run

The following pr updates the runBenchMark function by:

  1. Breaking the runBenchMark function into the getArgv for the purpose of getting the argv array.
  2. When constructing the argv array, we are reducing the args array parameter. That way we make one push operation instead of two per iteration.
  3. Instead of contatinating an array per iteration on line https://github.com/nodejs/node/compare/master...fesebuv:fesebuv-updates?expand=1#diff-f282ba153a1c9657bd17a47caabab8bfR29 we are pushing that line into an array and then joining that array when needed.

Run

time ./node ./test/sequential/test-benchmark-buffer

  • Should see time reducing from real ~0m5.570s to real ~0m5.479s
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Merge request reports

Loading