-
Notifications
You must be signed in to change notification settings - Fork 24
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
Address outstanding L2 issues #35
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of minor ReSpec thingies. You should probably run tidy over the document after this gets merged. The markup is a little messy, so will make review easier once cleaned up.
index.html
Outdated
|
||
noLegacyStyle: true, | ||
noLegacyStyle: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this, as it does nothing :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
index.html
Outdated
value: 'Test Suite repository', | ||
href: 'https://github.com/w3c/web-platform-tests/tree/master/user-timing' | ||
}] | ||
otherLinks: [{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace github related things inotherLinks
this with:
github: "https://github.com/w3c/user-timing/"
Once you do that, you can also drop edDraftURI
, as it should be automatically generated for you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. @marcoscaceres can you confirm I did it right?
index.html
Outdated
which expose a high precision, monotonically increasing timestamp so they can better measure the performance characteristics of their applications.</p> | ||
|
||
},{ | ||
key: 'Mailing list', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how the group likes to work, but in other groups we've been discouraging mailing lists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto, we can point to GH.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
index.html
Outdated
value: 'Can I use User Timing?', | ||
href: 'http://caniuse.com/#feat=user-timing' | ||
}, { | ||
value: 'Test Suite', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use testSuiteURI
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Polite ping: @igrigorik |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about the delay! The formatting update made this a tricky one to review. A few of the suggestions I noted are not directly related to the earlier commits, but would be good to address as part of this update nonetheless.
index.html
Outdated
which expose a high precision, monotonically increasing timestamp so they can better measure the performance characteristics of their applications.</p> | ||
|
||
},{ | ||
key: 'Mailing list', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto, we can point to GH.
index.html
Outdated
<h2><dfn>mark()</dfn> method</h2> | ||
<p>Stores a timestamp with the associated name (a "mark"). It MUST run these steps:</p> | ||
<ol> | ||
<li>Run the <a href="#ensure-name-is-valid">ensure name is valid</a> algorithm with <var>name</var> set to <var>markName</var>.</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make thing simple, why not use same name in the algorithm definition to allow <a>concept</a>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this step it's not clear where markName is sourced from, as there is no mention of it in the definition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make thing simple, why not use same name in the algorithm definition to allow concept?
Done. Didn't know that was possible :)
In this step it's not clear where markName is sourced from, as there is no mention of it in the definition.
Is it not? markName
is used exactly as it's used in the IDL, do I need to link to it or something? I'm not sure what you mean by "there is no mention of it in the definition".
index.html
Outdated
<ol> | ||
<li>Run the <a href="#ensure-name-is-valid">ensure name is valid</a> algorithm with <var>name</var> set to <var>markName</var>.</li> | ||
<li>Create a new <a>PerformanceMark</a> object.</li> | ||
<li>Set <code>name</code> to <var>markName</var>.</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and following steps implicitly refer to the new object. Let's be explicit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
index.html
Outdated
<h2><dfn>measure()</dfn> method</h2> | ||
<p>Stores the <code>DOMHighResTimeStamp</code> duration between two marks along with the associated name (a "measure"). It MUST run these steps:</p> | ||
<ol> | ||
<li>Run the <a href="#ensure-name-is-valid">ensure name is valid</a> algorithm with <var>name</var> set to <var>measureName</var>.</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as mark() on measureName.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sanity check.. the throw behavior for measure is not what we enforce in Chrome today. Did we agree that this is, indeed, the desired behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filed #36 to track this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as mark() on measureName.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
index.html
Outdated
<li>Let <var>end time</var> be <code>0</code>.</li> | ||
<li>If <var>endMark</var> is omitted, let <var>end time</var> be the value that would be returned by the <code>Performance</code> object's <a data-cite="!HR-TIME-2#dom-performance-now"><code>now()</code></a> method. Otherwise: | ||
<ol> | ||
<li>If <var>endMark</var> has the same name as a <a data-cite="!WEBIDL#dfn-read-only">read only attribute</a> in the <code><a data-cite="!NAVIGATION-TIMING#performancetiming">PerformanceTiming</a></code> interface, let <var>end time</var> be the value return by running the <a href="#convert-a-name-to-a-timestamp">convert name to a timestamp</a> algorithm with <var>name</var> set to <var>endMark</var>.</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"value returned"? Multiple occurrences..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with name set to the value of endmark?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with name set to the value of endmark?
Done.
"value returned"? Multiple occurrences..
I don't see multiple values being returned. Is that what you're implying?
index.html
Outdated
</ol> | ||
</li> | ||
<li>Create a new <a>PerformanceMeasure</a> object.</li> | ||
<li>Set <code>name</code> to <var>measureName</var>.</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as mark for Set.. substeps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
index.html
Outdated
<li>If <var>endTime</var> is <code>0</code>, <a data-cite="!WEBIDL#dfn-throw">throw</a> an <a data-cite="!WEBIDL#invalidaccesserror"><code>InvalidAccessError</code></a>.</li> | ||
<li>Return result of subtracting <var>startTime</var> from <var>endTime</var>.</li> | ||
</ol> | ||
</section> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would also be helpful to add a non-normative note, either as a preface, or after each algorithm here to note that: (a) PerformanceTiming was defined by NT1 and is now considered obsolete, (b) there are no plans to extend this functionality to PerformanceNavigationTiming (NT2).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
<section class="informative" id="introduction"> | ||
<h2>Introduction</h2> | ||
<p>Web developers need the ability to assess and understand the performance characteristics of their applications. While JavaScript <a href="#ECMA262">[ECMA262]</a> provides a mechanism to measure application latency (retrieving the current timestamp from the <code>Date.now()</code> method), the precision of this timestamp varies between user agents.</p> | ||
<p>This document defines the <a>PerformanceMark</a> and <a>PerformanceMeasure</a> interfaces, and extensions to the <a href="#extensions-performance-interface"><code>Performance</code></a> interface, which expose a high precision, monotonically increasing timestamp so they can better measure the performance characteristics of their applications.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be worthwhile to mention here the benefits of mark()
/measure()
relative to performance.now()
. Without mentioning performance.now()
, Date.now()
might seem like a straw man.
Perhaps mentioning Dev Tools support or support in tools like Windows Performance Analyzer and WebPageTest may be worth putting in a non-normative section. Not sure if it's out-of-scope for this document though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. I opened #37 to track this so we can get this PR close quicker.
@igrigorik BTW, in case you're not aware, in Github you can add |
index.html
Outdated
<p>The <a>PerformanceMark</a> interface extends the following attributes of the <a data-cite="!PERFORMANCE-TIMELINE-2#performanceentry">PerformanceEntry</a> | ||
interface:</p> | ||
<p>The <code>name</code> attribute will return the mark's name.</p> | ||
<p>The <code>entryType</code> attribute will return the <a data-cite="!WEBIDL#idl-DOMString"><code>DOMString</code></a> <code>"mark"</code>.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these redefinitions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not quite sure what you mean by that, but regardless, I didn't make any content changes here. Maybe @igrigorik can comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, let me be more clear. This section is about interface PerformanceMark
, then it talks about entryType
attribute. Where is entryType
defined? Why is it being discussed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is, PerformanceEntry
defines the entryType
attribute (which is in a different spec), thus this spec should not (re)define the entryType
attribute. That's not great, imo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marcoscaceres PerformanceMark inherits entryType from PerformanceEntry, and we're defining what PerformanceMark should return for entryType; this use is consistent with how we intended this to be defined and the pattern we've followed across all of our specs.
I don't see any issues here, but open to suggestions if there's a better way to do this. That said, given that this is a standard pattern we've been using, we don't need to block this update on this. If there's a better way to do this, let's take that as a meta issue.
@igrigorik thanks for the feedback. I believe I addressed all the issues, so could you PTAL again? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@philipwalton thanks for iterating on this, I think we're close! A few questions and comments.
index.html
Outdated
<p>The <a>PerformanceMark</a> interface extends the following attributes of the <a data-cite="!PERFORMANCE-TIMELINE-2#performanceentry">PerformanceEntry</a> | ||
interface:</p> | ||
<p>The <code>name</code> attribute will return the mark's name.</p> | ||
<p>The <code>entryType</code> attribute will return the <a data-cite="!WEBIDL#idl-DOMString"><code>DOMString</code></a> <code>"mark"</code>.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marcoscaceres PerformanceMark inherits entryType from PerformanceEntry, and we're defining what PerformanceMark should return for entryType; this use is consistent with how we intended this to be defined and the pattern we've followed across all of our specs.
I don't see any issues here, but open to suggestions if there's a better way to do this. That said, given that this is a standard pattern we've been using, we don't need to block this update on this. If there's a better way to do this, let's take that as a meta issue.
@@ -1,144 +1,99 @@ | |||
<!DOCTYPE html> | |||
<html> | |||
<head> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Viewing current snapshot, I see a respec validation error:
"Found linkless element for 'performance' with text 'ensure name is valid' but no matching ."
Does this algorithm still exist / is needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, forgot to remove this line when updating the spec to fix #36.
index.html
Outdated
<li>Let <var>end time</var> be <code>0</code>.</li> | ||
<li>If <var>endMark</var> is omitted, let <var>end time</var> be the value that would be returned by the <code>Performance</code> object's <a data-cite="!HR-TIME-2#dom-performance-now"><code>now()</code></a> method. Otherwise: | ||
<ol> | ||
<li>If <var>endMark</var> has the same name as a <a data-cite="!WEBIDL#dfn-read-only">read only attribute</a> in the <code><a data-cite="!NAVIGATION-TIMING#performancetiming">PerformanceTiming</a></code> interface, let <var>end time</var> be the value returned by running the <a>convert a name to a timestamp</a> algorithm with <var>name</var> set to the value of <var>endMark</var>.</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current logic will throw a SyntaxError inside a Worker if you use NavigationTiming attribute name. Sanity check: is this intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is what we decided in #22.
index.html
Outdated
</li> | ||
<li>If <var>startMark</var> is omitted, let <var>start time</var> be <code>0</code>. Otherwise: | ||
<ol> | ||
<li>If <var>startMark</var> has the same name as a <a data-cite="!WEBIDL#dfn-read-only">read only attribute</a> in the <code><a data-cite="!NAVIGATION-TIMING#performancetiming">PerformanceTiming</a></code> interface, let <var>start time</var> be the value return by running the <a>convert a name to a timestamp</a> algorithm with <var>name</var> set to <var>startMark</var>.</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe so. This matches current implementations and tests as mentioned in #21.
index.html
Outdated
</pre> | ||
<p>The <a>PerformanceMark</a> interface extends the following attributes of the <a data-cite="!PERFORMANCE-TIMELINE-2#performanceentry">PerformanceEntry</a> | ||
interface:</p> | ||
<p>The <code>name</code> attribute will return the mark's name.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/will/must .. same for steps below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good.
As a side note, in #36 we're looking for confirmation from Mozilla on the measure+SyntaxError behavior. Technically, this PR does not change existing per-spec behavior, so in theory it's OK to merge. That said, it'd be nice to get confirmation on #36 and land the corresponding WPT updates to lock all of this in.
@marcoscaceres @digitarald can you please review?
Merging the update per the 2/22 call. Will follow up with Mozilla regarding #36 in that issue. |
This PR closes #21, #22, #26, and #31. It also fixes formatting inconsistencies, improves linking between specs, and adjusts the section hierarchy to be more consistent with other web-perf specs.