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

Address outstanding L2 issues #35

Merged
merged 11 commits into from
Feb 22, 2018
Merged

Address outstanding L2 issues #35

merged 11 commits into from
Feb 22, 2018

Conversation

philipwalton
Copy link
Member

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.

Copy link
Member

@marcoscaceres marcoscaceres left a 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,
Copy link
Member

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 :)

Copy link
Member Author

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: [{
Copy link
Member

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.

Copy link
Member Author

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',
Copy link
Member

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.

Copy link
Member

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.

Copy link
Member Author

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',
Copy link
Member

Choose a reason for hiding this comment

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

Please use testSuiteURI instead.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@philipwalton
Copy link
Member Author

Polite ping: @igrigorik

Copy link
Member

@igrigorik igrigorik left a 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',
Copy link
Member

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

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>?

Copy link
Member

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.

Copy link
Member Author

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

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?

Copy link
Member Author

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

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.

Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member Author

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added 242a0ea to address #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 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>
Copy link
Member

Choose a reason for hiding this comment

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

"value returned"? Multiple occurrences..

Copy link
Member

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?

Copy link
Member Author

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

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.

Copy link
Member Author

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

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).

Copy link
Member Author

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

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.

Copy link
Member Author

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.

@philipwalton
Copy link
Member Author

The formatting update made this a tricky one to review.

@igrigorik BTW, in case you're not aware, in Github you can add ?w=1 to the end of a diff URL and have it ignore whitespace. It's really helpful for diffs like this.

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

Choose a reason for hiding this comment

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

Are these redefinitions?

Copy link
Member Author

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?

Copy link
Member

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?

Copy link
Member

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.

Copy link
Member

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.

@philipwalton
Copy link
Member Author

@igrigorik thanks for the feedback. I believe I addressed all the issues, so could you PTAL again?

Copy link
Member

@igrigorik igrigorik left a 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>
Copy link
Member

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

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?

Copy link
Member Author

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

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?

Copy link
Member Author

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

Choose a reason for hiding this comment

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

Same as above.

Copy link
Member Author

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

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Copy link
Member

@igrigorik igrigorik left a 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?

@toddreifsteck
Copy link
Member

Merging the update per the 2/22 call. Will follow up with Mozilla regarding #36 in that issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

measure() may throw SyntaxError
5 participants