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: use strict mode #5336

Closed
wants to merge 1 commit into from
Closed

Conversation

Trott
Copy link
Member

@Trott Trott commented Feb 20, 2016

Apply strict mode to benchmark code.

Apply strict mode to benchmark code.
@Trott Trott added benchmark Issues and PRs related to the benchmark subsystem. lts-watch-v4.x labels Feb 20, 2016
@jasnell
Copy link
Member

jasnell commented Feb 20, 2016

@trevnorris @bnoordhuis ... any insight into how this would affect the benchmarks?

@silverwind
Copy link
Contributor

LGTM, I take it this is preparation to lint the benchmarks?

@bnoordhuis
Copy link
Member

LGTM

any insight into how this would affect the benchmarks?

Strict mode should not have a negative impact on the benchmark numbers, if that is what you're asking. It might even improve them.

@jasnell
Copy link
Member

jasnell commented Feb 20, 2016

Yep, that's what I was asking! I'm not overly familiar with the internals
of strict mode so wanted to double check. This LGTM
On Feb 20, 2016 3:18 AM, "Ben Noordhuis" notifications@github.com wrote:

LGTM

any insight into how this would affect the benchmarks?

Strict mode should not have a negative impact on the benchmark numbers, if
that is what you're asking. It might even improve them.


Reply to this email directly or view it on GitHub
#5336 (comment).

@Trott
Copy link
Member Author

Trott commented Feb 20, 2016

@silverwind asks:

I take it this is preparation to lint the benchmarks?

That's the hope.

@evanlucas
Copy link
Contributor

LGTM

1 similar comment
@Fishrock123
Copy link
Contributor

LGTM

@@ -1,3 +1,4 @@
'use strict';
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe add a space on the 2nd line for these?

Copy link
Member Author

Choose a reason for hiding this comment

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

In our current tests, it is atypical to have a blank line after use strict. (In test/parallel, there are 943 tests that contain use strict. Of those, only 108 contain a blank line after use strict.) So I favored the prevailing convention of no blank line. (Although I see I was not quite 100% consistent with that here. Ugh.)

Anyway, I don't have any strong feelings about it, but that's why I did it the way I did.

Trott added a commit to Trott/io.js that referenced this pull request Feb 22, 2016
Apply strict mode to benchmark code.

PR-URL: nodejs#5336
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@Trott
Copy link
Member Author

Trott commented Feb 22, 2016

Landed in 4bb529d.

It's worth mentioning perhaps that make bench-misc and possibly others were broken before this commit and are still broken, at least on my OS X machine. I'm guessing it's one of:

  • I'm Doing It Wrong
  • it's a known problem among people who do benchmarking
  • people who do benchmarking don't use that and don't care much that it's broken

@Trott Trott closed this Feb 22, 2016
rvagg pushed a commit that referenced this pull request Feb 27, 2016
Apply strict mode to benchmark code.

PR-URL: #5336
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@Fishrock123 Fishrock123 mentioned this pull request Mar 1, 2016
5 tasks
@MylesBorins
Copy link
Contributor

@Trott would you be willing to backport this to v4.x?

@Trott
Copy link
Member Author

Trott commented Mar 17, 2016

@thealphanerd If you can get #5123 backported first, that will make this one go a little easier.

@MylesBorins
Copy link
Contributor

@Trott the path improvements are not likely to land soon... if ever

@Trott
Copy link
Member Author

Trott commented Mar 17, 2016

OK, I'll backport this along with the others then.

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.

7 participants