diff options
author | Anatoli Papirovski <apapirovski@mac.com> | 2017-11-25 08:07:26 -0500 |
---|---|---|
committer | Anatoli Papirovski <apapirovski@mac.com> | 2017-11-28 16:32:15 -0500 |
commit | d8bc4f214641d7a58b2587b59994c12426cffc96 (patch) | |
tree | 7b100bafdf3057d42644610e030a999b7db60065 /benchmark/timers/set-immediate-depth-args.js | |
parent | fea1e05ba5588eeedc670c5bcfff9a362874deed (diff) | |
download | android-node-v8-d8bc4f214641d7a58b2587b59994c12426cffc96.tar.gz android-node-v8-d8bc4f214641d7a58b2587b59994c12426cffc96.tar.bz2 android-node-v8-d8bc4f214641d7a58b2587b59994c12426cffc96.zip |
timers: clean up for readability
Remove micro-optimizations that no longer yield any benefits,
restructure timers & immediates to be a bit more straightforward.
Adjust timers benchmarks to run long enough to offer meaningful data.
PR-URL: https://github.com/nodejs/node/pull/17279
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Diffstat (limited to 'benchmark/timers/set-immediate-depth-args.js')
-rw-r--r-- | benchmark/timers/set-immediate-depth-args.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/benchmark/timers/set-immediate-depth-args.js b/benchmark/timers/set-immediate-depth-args.js index 1f12ae6ec7..704b181451 100644 --- a/benchmark/timers/set-immediate-depth-args.js +++ b/benchmark/timers/set-immediate-depth-args.js @@ -2,7 +2,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - millions: [10] + millions: [5] }); function main(conf) { @@ -15,9 +15,9 @@ function main(conf) { function cb3(n, arg2, arg3) { if (--n) { if (n % 3 === 0) - setImmediate(cb3, n, true, null); + setImmediate(cb3, n, true, null, 5.1, null, true); else if (n % 2 === 0) - setImmediate(cb2, n, 5.1); + setImmediate(cb2, n, 5.1, true); else setImmediate(cb1, n); } @@ -25,9 +25,9 @@ function main(conf) { function cb2(n, arg2) { if (--n) { if (n % 3 === 0) - setImmediate(cb3, n, true, null); + setImmediate(cb3, n, true, null, 5.1, null, true); else if (n % 2 === 0) - setImmediate(cb2, n, 5.1); + setImmediate(cb2, n, 5.1, true); else setImmediate(cb1, n); } @@ -35,9 +35,9 @@ function main(conf) { function cb1(n) { if (--n) { if (n % 3 === 0) - setImmediate(cb3, n, true, null); + setImmediate(cb3, n, true, null, 5.1, null, true); else if (n % 2 === 0) - setImmediate(cb2, n, 5.1); + setImmediate(cb2, n, 5.1, true); else setImmediate(cb1, n); } |