Skip to content

Conversation

apapirovski
Copy link
Contributor

@apapirovski apapirovski commented Apr 22, 2019

Using Reflect.apply where the callback context does not need to change is unnecessary and less performant.

CI: https://ci.nodejs.org/job/node-test-pull-request/22638/
Benchmarks: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/354/

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

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot nodejs-github-bot added async_hooks Issues and PRs related to the async hooks subsystem. fs Issues and PRs related to the fs subsystem / file system. process Issues and PRs related to the process subsystem. timers Issues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout. labels Apr 22, 2019
@nodejs-github-bot

This comment has been minimized.

Using Reflect.apply where the callback context does not need
to change is unnecessary and less performant.
@apapirovski apapirovski force-pushed the patch-replace-reflect-apply branch from 4340e88 to f8bdb64 Compare April 22, 2019 19:43
@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

Copy link
Member

@devsnek devsnek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you post the diff from the bench?

@refack
Copy link
Contributor

refack commented Apr 23, 2019

Results of micro-benchmark { CATEGORY: process, FILTER: next-tick, RUNS: 100 }:

confidence improvement accuracy (*) (**) (***)
process/next-tick-breadth-args.js n=4000000 * 2.47 % ±2.30% ±3.03% ±3.89%
process/next-tick-breadth.js n=4000000 -1.89 % ±4.50% ±5.93% ±7.62%
process/next-tick-depth-args.js n=12000000 *** 9.25 % ±1.20% ±1.59% ±2.04%
process/next-tick-depth.js n=12000000 0.51 % ±1.61% ±2.12% ±2.73%
process/next-tick-exec-args.js n=5000000 *** 18.24 % ±6.44% ±8.49% ±10.91%
process/next-tick-exec.js n=5000000 ** 8.44% ±5.29% ±6.98% ±8.97%

@nodejs-github-bot
Copy link
Collaborator

@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 24, 2019
@danbev
Copy link
Contributor

danbev commented Apr 30, 2019

Landed in f4f937b.

@danbev danbev closed this Apr 30, 2019
danbev pushed a commit that referenced this pull request Apr 30, 2019
Using Reflect.apply where the callback context does not need
to change is unnecessary and less performant.

PR-URL: #27349
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
targos pushed a commit that referenced this pull request Apr 30, 2019
Using Reflect.apply where the callback context does not need
to change is unnecessary and less performant.

PR-URL: #27349
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@targos targos mentioned this pull request May 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
async_hooks Issues and PRs related to the async hooks subsystem. author ready PRs that have at least one approval, no pending requests for changes, and a CI started. fs Issues and PRs related to the fs subsystem / file system. process Issues and PRs related to the process subsystem. timers Issues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout.
Projects
None yet
Development

Successfully merging this pull request may close these issues.