Skip to content

Optimize cluster.setupMaster()

  • add cluster.setupMaster() benchmark
  • do not call call util._extend() with options if options is undefined
  • calling assert() is relatively expensive; check condition and only call assert if assertion will fail
  • inline the check for CLI debugger arguments in the only place it is used
$ node benchmark/compare.js  --runs 100 --old './node-old' --new './node-new' cluster > test.csv
$ cat test.csv | Rscript benchmark/compare.R bench
                                            improvement confidence      p.value
 cluster/setup-master.js optionsIndex=0 n=1      5.02 %        *** 0.0002622052
 cluster/setup-master.js optionsIndex=1 n=1      0.72 %            0.5565911325
$
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

benchmark cluster

Merge request reports

Loading