Repository navigation
Conversation
There was a problem hiding this comment.
What about moving this to the conditional in the caller function (options && options.breakOnSigint) to avoid creating the argsArray and calling fn.apply()?
Introduce benchmarks for vm.runInContext() and vm.runInThisContext().
Optimize for common cases in vm.runInContext() and vm.runInThisContext().
|
With the change suggested by @mscdex: |
|
LGTM. FWIW here's the results I got when testing locally with a larger number of iterations: |
|
@mscdex Is that with a large |
|
@Trott I left the |
| if (withSigintListener) | ||
| process.on('SIGINT', () => {}); | ||
|
|
||
| var i = 0; |
There was a problem hiding this comment.
Out of curiosity, is there a reason you define i here and not in the for block where it's used?
There was a problem hiding this comment.
I used crypto/get-ciphers.js as a template and that is what is done there. I have no strong opinions on it so I left it outside the block.
| const common = require('../common.js'); | ||
|
|
||
| const bench = common.createBenchmark(main, { | ||
| n: [1], |
There was a problem hiding this comment.
Yeah, I had to bump up n considerably to get the benchmarks to run long enough for me to be comfortable with the results, but then again I find myself having to do that a lot with many of the other existing benchmarks ...
Introduce benchmarks for vm.runInContext() and vm.runInThisContext(). PR-URL: #10816 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Brian White <mscdex@mscdex.net>
Optimize for common cases in vm.runInContext() and vm.runInThisContext(). PR-URL: #10816 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Brian White <mscdex@mscdex.net>
Introduce benchmarks for vm.runInContext() and vm.runInThisContext(). PR-URL: nodejs#10816 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Brian White <mscdex@mscdex.net>
Optimize for common cases in vm.runInContext() and vm.runInThisContext(). PR-URL: nodejs#10816 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Brian White <mscdex@mscdex.net>
Introduce benchmarks for vm.runInContext() and vm.runInThisContext(). PR-URL: nodejs#10816 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Brian White <mscdex@mscdex.net>
Optimize for common cases in vm.runInContext() and vm.runInThisContext(). PR-URL: nodejs#10816 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Brian White <mscdex@mscdex.net>
Introduce benchmarks for vm.runInContext() and vm.runInThisContext(). PR-URL: nodejs#10816 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Brian White <mscdex@mscdex.net>
Optimize for common cases in vm.runInContext() and vm.runInThisContext(). PR-URL: nodejs#10816 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Brian White <mscdex@mscdex.net>
Introduce benchmarks for vm.runInContext() and vm.runInThisContext(). PR-URL: nodejs#10816 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Brian White <mscdex@mscdex.net>
Optimize for common cases in vm.runInContext() and vm.runInThisContext(). PR-URL: nodejs#10816 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Brian White <mscdex@mscdex.net>
|
lts??? |
|
ping re: LTS |
|
Since it's a perf-based refactor and not a behavior change, I think landing on 6.x is appropriate. |
|
This does not land cleanly in LTS. Would someone be able to backport? |
|
@MylesBorins This will land cleanly after #9388 lands on v6.x-staging. |
|
Removing the |
|
@Trott fwiw I doubt the naming anonymous functions is going to be backported for a couple releases |
|
Adding |
Optimize for common cases in
vm.runInContext()andvm.runInThisContext()whenbreakOnSigintis set.Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
vm benchmark