Skip to content

benchmark: var to const - #13757

Closed
BridgeAR wants to merge 1 commit into
nodejs:masterfrom
BridgeAR:var-to-const-benchmark
Closed

benchmark: var to const#13757
BridgeAR wants to merge 1 commit into
nodejs:masterfrom
BridgeAR:var-to-const-benchmark

Conversation

@BridgeAR

Copy link
Copy Markdown
Member

As discussed in #13732: this will change all var to const if applicable.
The main question is if this is wanted due to the churn.

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

benchmark

@nodejs-github-botnodejs-github-bot added benchmark Issues and PRs related to the benchmark subsystem. buffer Issues and PRs related to the buffer subsystem. child_process Issues and PRs related to the child_process subsystem. cluster Issues and PRs related to the cluster subsystem. crypto Issues and PRs related to the crypto subsystem. dgram Issues and PRs related to the dgram subsystem / UDP. domain Issues and PRs related to the domain subsystem. v8 engine Issues and PRs related to the V8 dependency. labels Jun 18, 2017
@mscdexmscdex removed buffer Issues and PRs related to the buffer subsystem. child_process Issues and PRs related to the child_process subsystem. cluster Issues and PRs related to the cluster subsystem. crypto Issues and PRs related to the crypto subsystem. dgram Issues and PRs related to the dgram subsystem / UDP. domain Issues and PRs related to the domain subsystem. v8 engine Issues and PRs related to the V8 dependency. labels Jun 18, 2017

@tniessentniessen 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.

I don't have a strong opinion on this if someone can confirm that there is no performance degression.

Comment threadbenchmark/process/next-tick-depth.js Outdated

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.

Any particular reason why you introduced a LF here but not in other files?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

It stumbled over it while I cherry-picked this part from the other PR due to a conflict in this file. I can keep it as it is if you want me to undo it.

@tniessentniessen self-assigned this Jun 18, 2017
@tniessen

Copy link
Copy Markdown
Member

@jasnell

Copy link
Copy Markdown
Member

Historically, we have held off updating the code in benchmarks so that we can more realistically compare performance with older Node.js versions. We should be careful making these kinds of changes. @mscdex ... thoughts?

@mscdex

Copy link
Copy Markdown
Contributor

I don't have any opinion, we currently have mixed const usage throughout all benchmarks. *shrug*

@BridgeAR

Copy link
Copy Markdown
MemberAuthor

Is there any conclusion about how to further progress? I guess as the benchmarks already contain const, this is a safe thing?

Note: the benchmarks change fast and I did this change by having a own eslint fix rule, so I would rebase as soon as there's a conclusion about how to go on.

@BridgeAR

Copy link
Copy Markdown
MemberAuthor

Just as info - I am going to update this as soon as v8 6.1 lands. I think we are safe to land this because we already use const in the benchmarks and it will only only deopt in rare cases in older v8 versions.

@jasnell

Copy link
Copy Markdown
Member

I'm marking it blocked for now then. Please remove the label when you're ready to update!

@jasnelljasnell added blocked PRs that are blocked by other issues or PRs. wip Issues and PRs that are still a work in progress. labels Aug 25, 2017
@BridgeARBridgeAR removed the blocked PRs that are blocked by other issues or PRs. label Sep 13, 2017
@BridgeAR
BridgeARforce-pushed the var-to-const-benchmark branch from 63e4520 to c60a7cdCompareSeptember 14, 2017 01:50
@BridgeARBridgeAR removed the wip Issues and PRs that are still a work in progress. label Sep 14, 2017
@BridgeAR

Copy link
Copy Markdown
MemberAuthor

Rebased. This should now be possible to land since we got v8 6.1 on master.

@mcollinamcollina 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.

LGTM

@mcollina

Copy link
Copy Markdown
Member

@bmeurer what do you think?

@BridgeAR

Copy link
Copy Markdown
MemberAuthor

I would like to land this soon because the code base changes fast and I have to rebase often otherwise.

@bmeurerbmeurer 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.

Nice cleanup!

@BridgeAR
BridgeARforce-pushed the var-to-const-benchmark branch from c60a7cd to 3e0bb2dCompareSeptember 20, 2017 00:12
@BridgeAR

Copy link
Copy Markdown
MemberAuthor

Thanks a lot! Landed in e167ab7

BridgeAR added a commit that referenced this pull request Sep 20, 2017
PR-URL: #13757
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
@jasnell

Copy link
Copy Markdown
Member

This requires #14881 backport to land in v8.x before it can be cherry-picked

BridgeAR added a commit to BridgeAR/node that referenced this pull request Sep 21, 2017
PR-URL: nodejs#13757
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
jasnell pushed a commit that referenced this pull request Sep 21, 2017
PR-URL: #13757
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Qard pushed a commit to Qard/ayo that referenced this pull request Sep 21, 2017
PR-URL: nodejs/node#13757
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Qard pushed a commit to Qard/ayo that referenced this pull request Sep 21, 2017
PR-URL: nodejs/node#13757
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
@MylesBorins

Copy link
Copy Markdown
Contributor

Should this be backported to v6.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.

This is likely to make benchmarks on 6.x slower though. TBQH I'm not sure this should have landed prior to 6.x going into maintenance mode as it will make future backports harder. That being said benchmarks have diverged quite a bit so it might be a moot point.

Glad to see this was part of the conversation prior to landing.

@BridgeAR

Copy link
Copy Markdown
MemberAuthor

After looking at this again I do not really see the necessity for a backport here. If we add a new benchmark, backporting will be fine all the time. Changing benchmarks happens pretty rarely otherwise. If a backport is really necessary, I am of course fine to do so. It is not really much work as I just use a individual eslint rule for it. I am not sure anymore how bad const was in v.6 but I am pretty sure const was fine in most cases. Especially when looking at the changed variables.

@MylesBorins your call if I should open a backport or not.

@BridgeAR
BridgeAR deleted the var-to-const-benchmark branch April 1, 2019 23:37
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

benchmarkIssues and PRs related to the benchmark subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants

@BridgeAR@tniessen@jasnell@mscdex@mcollina@MylesBorins@bmeurer@lpinca@gibfahn@nodejs-github-bot