console: sub-millisecond accuracy for console.time - #3166
Conversation
e05ca84 to
140f0fe
Compare
|
I just pushed an update to the doc. |
There was a problem hiding this comment.
Why this change is necessary?
Edit: Ah, I see it now. That is kind of the point of this PR
There was a problem hiding this comment.
Bikeshedding: this belongs to the first commit «console: sub-millisecond accuracy for console.time», not to «doc: reword description of console.time».
There was a problem hiding this comment.
I moved this change to the first commit
|
Should it be |
|
LGTM if CI is happy and if there's consensus on the semver implications of the change. |
|
CI: https://ci.nodejs.org/job/node-test-commit/720/ |
There was a problem hiding this comment.
Btw, this change is not directly related to this PR.
|
The JS part LGTM. |
|
@ChALkeR you are right, the doc refs are broken because I changed the titles. Do you you prefer to review the doc changes in another PR or just a second commit in this one ? |
There was a problem hiding this comment.
If we consider the output of the console functions to be part of the API, the I think one could view this as semver-major. The change to thses tests demonstrates how downstream apps output parsing will break.
There was a problem hiding this comment.
Good point, I don't know what is the policy about console output.
Recent changes to the output of util.format were considered semver-minor IIRC.
cc @nodejs/collaborators
There was a problem hiding this comment.
I'm going to say semver-minor for changes to console output but it's never as clear cut as it appears. For this, I personally feel it's small enough of a change that -minor is appropriate.
There was a problem hiding this comment.
The probability of this breaking anything is near zero. Still, there seems to be no reason for pulling this into 4.x branch.
|
I'm not sure this isn't actually It's almost irrelevant right now. It'l probably have to land in v5.x anyways, but we should err on the side of caution still. |
|
OK for semver-major, this is safer. I added it to the 5.0 milestone. |
140f0fe to
12a090c
Compare
|
I put the doc changes in a separate commit. PTAL. |
There was a problem hiding this comment.
Maybe call the parameter timerName to be in line with mdn?
There was a problem hiding this comment.
same could be done in code, maybe as a seperate commit too.
|
«console: sub-millisecond accuracy for console.time» + one-line doc change («262ms» → «225.438ms») LGTM. |
|
LGTM if CI is green |
|
|
|
@Trott ... no, |
|
That said, if the change may be controversial or particularly disruptive, you may want to hold off landing until more folks have had the time to review it. |
|
@jasnell is correct. There's no reason to hold off universally approved |
|
The
Maybe the Or maybe it really does need TSC review. As recently as three days ago, that was the conclusion for a different /cc @Fishrock123 |
|
I don't think that means we need to have a formal vote on the breaking change. Only that someone from the TSC approves the PR. |
|
@trevnorris +1 for a liberal interpretation of |
I would dispute not:
https://github.com/nodejs/dev-policy#accepting-modifications-through-a-consensus-seeking-process I think it is best to keep it this way, at least for now. |
See above. :) |
|
CI is happy minus the usual @Trott @evanlucas @ChALkeR @nodejs/tsc: LGTY ? |
There was a problem hiding this comment.
Nittiest of all possible nits: The last sentence describes the timer precision, not the accuracy.
Slightly less nitty nit: sub-millisecond is true, but we know that it will be three decimal places, so you could just say it's to the microsecond.
Of course, I can't come up with wording for either of these nits that's better than what's already there, so ¯_(ツ)_/¯
There was a problem hiding this comment.
The last sentence describes the timer precision, not the accuracy.
You are right, I will replace "accurate" with "precise" when I land it if nobody objects.
... so you could just say it's to the microsecond
I wanted to do that but I am not sure it's true all the time and on all platforms. Perhaps if the CPU is overloaded we can lose precision ? I really don't know.
There was a problem hiding this comment.
Another possibility is just to remove that last sentence entirely. I don't think MDN indicates how many decimal places their timer is good for, for example. People can use it and they get as many decimal places as they get.
MDN stuff for reference:
There was a problem hiding this comment.
For this sentence I took inspiration from https://developer.chrome.com/devtools/docs/console-api#consoletimelabel
I fine with removing it as well
There was a problem hiding this comment.
Ah. Well, in that case, I'm fine with leaving it. If it's good enough for Chrome docs, it's good enough for me.
Sorry for all the bikeshedding on this. LGTM no matter which way you decide to go with it (leave it, remove it, change it as described).
commented
Oct 9, 2015
|
A couple of nits, but I'm OK if they're addressed at a later date or ignored entirely. (They're nits after all.) LGTM |
commented
Oct 9, 2015
|
Overall LGTM. There's one more slight difference to browser implementations: They limit the amount of active timers to 10000. I don't think we need this, but at least mention it. |
commented
Oct 9, 2015
|
Yes, they also don't throw when you call |
commented
Oct 16, 2015
|
Can I have a sign-off from someone in @nodejs/tsc ? |
commented
Oct 16, 2015
|
LGTM |
This makes the output of console.timeEnd in line with major browsers. PR-URL: nodejs#3166 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
PR-URL: nodejs#3166 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Name it timerName instead of label. It is clearer that way and matches the description in the doc. It is also how it's named in MDN. PR-URL: nodejs#3166 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
f1c7d44 to
8c043c1
Compare
commented
Oct 16, 2015
|
Thanks! Landed in 642928b...8c043c1 |
This makes the output of console.timeEnd in line with major browsers.