Skip to content

lib: remove Reflect.apply where appropriate - #27349

Closed
apapirovski wants to merge 1 commit into
nodejs:masterfrom
apapirovski:patch-replace-reflect-apply
Closed

lib: remove Reflect.apply where appropriate#27349
apapirovski wants to merge 1 commit into
nodejs:masterfrom
apapirovski:patch-replace-reflect-apply

Conversation

@apapirovski

@apapirovskiapapirovski commented Apr 22, 2019

Copy link
Copy Markdown
Contributor

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-botnodejs-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
apapirovskiforce-pushed the patch-replace-reflect-apply branch from 4340e88 to f8bdb64CompareApril 22, 2019 19:43
@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@devsnekdevsnek left a comment

Copy link
Copy Markdown
Member

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

refack commented Apr 23, 2019

Copy link
Copy Markdown
Contributor

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

confidenceimprovementaccuracy(*)(**)(***)
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=120000000.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
Copy Markdown
Collaborator

@BridgeARBridgeAR 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
Copy Markdown
Contributor

Landed in f4f937b.

@danbevdanbev 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>
@targostargos mentioned this pull request May 6, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

async_hooksIssues and PRs related to the async hooks subsystem.author readyPRs that have at least one approval, no pending requests for changes, and a CI started.fsIssues and PRs related to the fs subsystem / file system.processIssues and PRs related to the process subsystem.timersIssues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

11 participants

@apapirovski@nodejs-github-bot@refack@danbev@addaleax@Fishrock123@lpinca@targos@cjihrig@devsnek@BridgeAR