Skip to content

vm: improve performance of vm.runIn*()

Rodrigo Muino Tomonari requested to merge github/fork/Trott/optimize-vm into master

Optimize for common cases in vm.runInContext() and vm.runInThisContext() when breakOnSigint is set.

$ node benchmark/compare.js --set 'n=10'  --old './node-old' --new './node-new' vm > bench.csv
$ cat bench.csv | Rscript benchmark/compare.R bench
                                                                     improvement confidence      p.value
 vm/run-in-context.js withSigintListener=0 breakOnSigint=0 n=10           1.12 %            0.5268470825
 vm/run-in-context.js withSigintListener=0 breakOnSigint=1 n=10           6.90 %         ** 0.0039743927
 vm/run-in-context.js withSigintListener=1 breakOnSigint=0 n=10           5.19 %        *** 0.0001940968
 vm/run-in-context.js withSigintListener=1 breakOnSigint=1 n=10          -0.84 %            0.6936019893
 vm/run-in-this-context.js withSigintListener=0 breakOnSigint=0 n=10      0.14 %            0.9651596335
 vm/run-in-this-context.js withSigintListener=0 breakOnSigint=1 n=10      9.27 %         ** 0.0058309681
 vm/run-in-this-context.js withSigintListener=1 breakOnSigint=0 n=10      1.13 %            0.5957890149
 vm/run-in-this-context.js withSigintListener=1 breakOnSigint=1 n=10      2.21 %            0.2564659136
$ 
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)

vm benchmark

Merge request reports

Loading