Skip to content

Conversation

@joyeecheung
Copy link
Member

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

process

This PR is split into two commits in caution of breaking change, can be squashed when identified not breaking. Non breaking:

  • Add benchmarks for diffing a previous result
  • Improvements to the documentation, including type annotation
  • Update the oudated comments in src/node.cc
  • Comment process.hrtime and improve readability

Might be breaking: check the length of argument passed into process.hrtime(). Passing a user-defined array is previously described as undefined behavior in the documentation.

Benchmark results:

 improvement significant p.value process/bench-hrtime.js type="diff" n=1000000 0.28 % 0.8029355 process/bench-hrtime.js type="raw" n=1000000 -0.56 % 0.6488252 

@nodejs-github-botnodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. process Issues and PRs related to the process subsystem. dont-land-on-v7.x labels Jan 12, 2017
@jasnelljasnell added the semver-major PRs that contain breaking changes and should be released in the next major version. label Jan 12, 2017
@jasnell
Copy link
Member

Unfortunately because of the change in error condition this has to be labeled as semver-major.

Copy link
Member

Choose a reason for hiding this comment

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

nit: === for comparison

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Addressed.

@addaleax
Copy link
Member

Unfortunately because of the change in error condition this has to be labeled as semver-major.

I don’t think it has to be. As @joyeecheung mentioned in the PR description, this only adds a throw for situations that we explicitly declared to be undefined behavior in the docs. It’s probably best to consider it breaking, unless there’s a good reason not to do that.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please make these separate var statements?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Addressed

@joyeecheung
Copy link
MemberAuthor

@joyeecheung
Copy link
MemberAuthor

@jasnell If you still think it is semver-major, I am OK with landing this as semver-major.

@jasnell
Copy link
Member

I'm more comfortable landing it as semver-major

@addaleax
Copy link
Member

CI: https://ci.nodejs.org/job/node-test-commit/7257/ (Started this without seeing that one had already been kicked off. Sorry!)
CITGM: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/525/

@joyeecheung
Copy link
MemberAuthor

Going to land this if there is nothing else to be addressed. @mscdex Does this LGTY?

Copy link
Contributor

Choose a reason for hiding this comment

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

How about adding another test that has > 2 elements?

@mscdex
Copy link
Contributor

mscdex commented Jan 17, 2017

One nit, but I agree with @jasnell that I would lean more towards semver-major to be on the safe side. Otherwise LGTM.

* Add benchmarks for diffing a previous result * Improvements to the documentation, including type annotation * Update the outdated comments in src/node.cc, improve comments in lib/internal/process.js * Check the argument is an Array Tuple with length 2
@joyeecheung
Copy link
MemberAuthor

joyeecheung added a commit that referenced this pull request Jan 23, 2017
* Add benchmarks for diffing a previous result * Improvements to the documentation, including type annotation * Update the outdated comments in src/node.cc, improve comments in lib/internal/process.js * Check the argument is an Array Tuple with length 2 PR-URL: #10764 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Brian White <[email protected]>
@joyeecheung
Copy link
MemberAuthor

Landed in a647d82

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++Issues and PRs that require attention from people who are familiar with C++.processIssues and PRs related to the process subsystem.semver-majorPRs that contain breaking changes and should be released in the next major version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@joyeecheung@jasnell@addaleax@mscdex@targos@nodejs-github-bot