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

benchmark: convert var to es6 const, let #12886

Closed
wants to merge 3 commits into from
Closed

benchmark: convert var to es6 const, let #12886

wants to merge 3 commits into from

Conversation

sebasmurphy
Copy link
Contributor

@sebasmurphy sebasmurphy commented May 7, 2017

Converted var variable to es6 const and let to maintain
consistency with other benchmark files. Also clean up
the types array to make the files more succinct.

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

benchmark

Converted var variable to es6 const and let to maintain
consistency with other benchmark files. Also clean up
the types array to make the files more succinct.
@nodejs-github-bot nodejs-github-bot added benchmark Issues and PRs related to the benchmark subsystem. v8 engine Issues and PRs related to the V8 dependency. labels May 7, 2017
var arr = new clazz(n * 1e6);
for (var i = 0; i < 10; ++i) {
let arr = new clazz(n * 1e6);
for (let i = 0; i < 10; ++i) {
Copy link
Member

Choose a reason for hiding this comment

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

We don't use let in the benchmarks, and let causes a noticeable performance deficit with current V8.

Copy link
Contributor

Choose a reason for hiding this comment

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

@sebasmurphy wait with the lets a month or two until we activate TurboFan and Ignition nodejs/CTC#99

Copy link
Contributor

@refack refack left a comment

Choose a reason for hiding this comment

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

1. Revert the lets
2. show there is no performance regression - benchmark guide


bench.start();
var arr = new clazz(n * 1e6);
for (var i = 0; i < 10; ++i) {
for (let i = 0; i < 10; ++i) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Forgot the last one 😉

@refack
Copy link
Contributor

refack commented May 7, 2017

@sebasmurphy we forgot to say thank you.
Well, thank you! 🥇

@sebasmurphy
Copy link
Contributor Author

Thanks @refack. Still need to do the performance comparison.

@jasnell
Copy link
Member

jasnell commented May 9, 2017

I have no issues with the code itself, but just want to provide the context. Historically, we have avoided making such changes in the benchmarks in order to allow us to keep running the benchmarks against older versions of Node.js that do not have these constructs (think, 0.10 and 0.12). That said, now that all of those older versions are no longer supported, it should be perfectly fine to re-baseline the benchmarks on whatever is supported by Node.js 4.x. (or, moving forward, the oldest release line in LTS at any given point in time)

@refack
Copy link
Contributor

refack commented Jun 16, 2017

Ref: #13729

@bnoordhuis
Copy link
Member

Is this stalled or blocked on @refack's re-review?

@refack
Copy link
Contributor

refack commented Aug 17, 2017

It was mostly blocked till TF&I landed (#13729). So in my POV this could move forward.

Pre-land CI: https://ci.nodejs.org/job/node-test-pull-request/9713/

Copy link
Contributor

@refack refack left a comment

Choose a reason for hiding this comment

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

TF&I perturbed everything anyway, so it's a good opportunity to improve the code.

Copy link
Member

@tniessen tniessen left a comment

Choose a reason for hiding this comment

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

Change itself LGTM, even though the refactoring of the type array blows up the diff size.

@refack
Copy link
Contributor

refack commented Aug 17, 2017

Change itself LGTM, even though the refactoring of the type array blows up the diff size.

a trick @Trott tought me: add ?W=1 to the diff url - https://github.com/nodejs/node/pull/12886/files?w=1
Can use this as a bookmarklet: javascript:window.location.search = window.location.search + (window.location.search ? '&' : '?') + 'w=1';

@refack refack removed the v8 engine Issues and PRs related to the V8 dependency. label Aug 17, 2017
refack pushed a commit that referenced this pull request Aug 17, 2017
Converted var variable to es6 const to maintain
consistency with other benchmark files. Also clean up
the types array to make the files more succinct.

PR-URL: #12886
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
@refack
Copy link
Contributor

refack commented Aug 17, 2017

Landed in c49dcb3
@sebasmurphy thank you for first contribution and welcome.
Congratulations on GitHub promoting from:
image
to
image
🍾 🍰
If you would like to submit the conversion of the rest of the vars to lets, now that TF&I landed I think it will be most welcome.

@jasnell jasnell closed this Aug 18, 2017
MylesBorins pushed a commit that referenced this pull request Sep 10, 2017
Converted var variable to es6 const to maintain
consistency with other benchmark files. Also clean up
the types array to make the files more succinct.

PR-URL: #12886
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
@MylesBorins MylesBorins mentioned this pull request Sep 10, 2017
MylesBorins pushed a commit that referenced this pull request Sep 12, 2017
Converted var variable to es6 const to maintain
consistency with other benchmark files. Also clean up
the types array to make the files more succinct.

PR-URL: #12886
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
MylesBorins pushed a commit that referenced this pull request Sep 20, 2017
Converted var variable to es6 const to maintain
consistency with other benchmark files. Also clean up
the types array to make the files more succinct.

PR-URL: #12886
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
benchmark Issues and PRs related to the benchmark subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.