Skip to content

events: use Reflect.apply - #17456

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

events: use Reflect.apply#17456
apapirovski wants to merge 1 commit into
nodejs:masterfrom
apapirovski:patch-events-reflect-apply

Conversation

@apapirovski

@apapirovskiapapirovski commented Dec 4, 2017

Copy link
Copy Markdown
Contributor

Instead of callback bound apply, instead use the standard Reflect.apply. This is both safer and appears to offer a slight performance benefit. Perhaps due to not having to search the prototype tree? No clue tbh but I'm seeing 3-5% difference with substantial significance.

Refs: #12956

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

domain, events

@apapirovskiapapirovski added domain Issues and PRs related to the domain subsystem. events Issues and PRs related to the events subsystem / EventEmitter. labels Dec 4, 2017
@nodejs-github-botnodejs-github-bot added domain Issues and PRs related to the domain subsystem. events Issues and PRs related to the events subsystem / EventEmitter. labels Dec 4, 2017
@apapirovski

Copy link
Copy Markdown
ContributorAuthor

@BridgeAR

Copy link
Copy Markdown
Member

I would say this does not require 48 hours.

Instead of callback bound apply, instead use the standard
Reflect.apply. This is both safer and appears to offer
a slight performance benefit.
@apapirovski
apapirovskiforce-pushed the patch-events-reflect-apply branch from 73d2844 to 0587724CompareDecember 6, 2017 17:49
@apapirovski

apapirovski commented Dec 6, 2017

Copy link
Copy Markdown
ContributorAuthor

Missed a spot (+ rebased), have to run the CI again.

CI: https://ci.nodejs.org/job/node-test-pull-request/11916/

@apapirovski

Copy link
Copy Markdown
ContributorAuthor

Landed in f5eb803

@apapirovski
apapirovski deleted the patch-events-reflect-apply branch December 6, 2017 21:36
apapirovski added a commit that referenced this pull request Dec 6, 2017
Instead of callback bound apply, instead use the standard
Reflect.apply. This is both safer and appears to offer
a slight performance benefit.
PR-URL: #17456
Refs: #12956
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
@starkwangstarkwang mentioned this pull request Dec 7, 2017
2 tasks
@MylesBorins

Copy link
Copy Markdown
Contributor

Should this be backported to v9.x-staging? If yes please follow the guide and raise a backport PR, if not let me know or add the dont-land-on label.

apapirovski added a commit to apapirovski/node that referenced this pull request Jan 31, 2018
Instead of callback bound apply, instead use the standard
Reflect.apply. This is both safer and appears to offer
a slight performance benefit.
PR-URL: nodejs#17456
Refs: nodejs#12956
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
MylesBorins pushed a commit that referenced this pull request Feb 20, 2018
Instead of callback bound apply, instead use the standard
Reflect.apply. This is both safer and appears to offer
a slight performance benefit.
Backport-PR-URL: #18487
PR-URL: #17456
Refs: #12956
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
@MylesBorins

Copy link
Copy Markdown
Contributor

Setting this as don't land for LTS, please let me know if this should be changed

@MylesBorinsMylesBorins mentioned this pull request Feb 21, 2018
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domainIssues and PRs related to the domain subsystem.eventsIssues and PRs related to the events subsystem / EventEmitter.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants

@apapirovski@BridgeAR@MylesBorins@jasnell@lpinca@TimothyGu@targos@cjihrig@nodejs-github-bot