Skip to content

benchmark: use strict mode - #5336

Closed
Trott wants to merge 1 commit into
nodejs:masterfrom
Trott:lint-benchmark
Closed

benchmark: use strict mode#5336
Trott wants to merge 1 commit into
nodejs:masterfrom
Trott:lint-benchmark

Conversation

@Trott

Copy link
Copy Markdown
Member

Apply strict mode to benchmark code.

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

Copy link
Copy Markdown
Member

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

@silverwind

Copy link
Copy Markdown
Contributor

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

@bnoordhuis

Copy link
Copy Markdown
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
Copy Markdown
Member

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
Copy Markdown
MemberAuthor

@silverwind asks:

I take it this is preparation to lint the benchmarks?

That's the hope.

@evanlucas

Copy link
Copy Markdown
Contributor

LGTM

1 similar comment
@Fishrock123

Copy link
Copy Markdown
Contributor

LGTM

@@ -1,3 +1,4 @@
'use strict';

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

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
Copy Markdown
MemberAuthor

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

@TrottTrott 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>
@Fishrock123Fishrock123 mentioned this pull request Mar 1, 2016
5 tasks
@MylesBorins

Copy link
Copy Markdown
Contributor

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

@Trott

Copy link
Copy Markdown
MemberAuthor

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

@MylesBorins

Copy link
Copy Markdown
Contributor

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

@Trott

Copy link
Copy Markdown
MemberAuthor

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

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.

7 participants

@Trott@jasnell@silverwind@bnoordhuis@evanlucas@Fishrock123@MylesBorins