Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: remove Reflect.apply where appropriate #27349

Closed

Conversation

apapirovski
Copy link
Member

@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 <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
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 <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
@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.