Intent to Implement: Performance.timeOrigin

85 views
Skip to first unread message

n...@chromium.org

unread,
Jul 24, 2017, 2:27:47 PM7/24/17
to blink-dev, Ilya Grigorik

Contact emails

n...@chromium.org  igri...@chromium.org


Spec

https://www.w3.org/TR/hr-time-3/#time-origin-timestamp


TAG review: not for this specifically, but this is an extension of HR-Time.


Summary

Implement the timeOrigin attribute of the Performance interface.


Motivation

This attribute is useful for developers to be able to compare timings of entries sourced from different time origins (like windows or workers). See https://www.w3.org/TR/hr-time-3/#examples


Interoperability and Compatibility Risk

The spec specifies that this attribute can expose some additional clock drift resolution but nothing significantly more than what was previously known: https://www.w3.org/TR/hr-time-3/#clock-drift


Edge: Supported in preview

Firefox: Supported

Safari: No

Web developers: Positive


Ongoing technical constraints

None


Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes.


OWP launch tracking bug

747989


Link to entry on the feature dashboard

https://www.chromestatus.com/feature/5695487386583040


Requesting approval to ship?

No


Matt Falkenhagen

unread,
Jul 25, 2017, 4:11:41 AM7/25/17
to n...@chromium.org, blink-dev, Ilya Grigorik
I just noticed a similar thing in a recent code review and commented there: https://chromium-review.googlesource.com/c/563957/

Just want to raise the point here also that Blink doesn't really follow the order of events in the spec, so the "official moment of creation", which is the time origin for workers, is different than what the spec seems to intend. Namely, Blink typically first fetches the worker's script on the main thread, and then starts a worker thread, passes it the source code, and creates the WorkerGlobalScope there. The spec expects us to first create the worker thread ("official moment of creation"), then fetch the script from there.

I'm not sure whether this matters but it seems worth noting and possibly working to fix.

Aside: Is it intentional to track <https://www.w3.org/TR/hr-time-3/> instead of the latest editor's draft: <https://w3c.github.io/hr-time/>? Are there any differences between the two?

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/2cceb250-c21b-44a8-a41a-2adde366ea0f%40chromium.org.

n...@chromium.org

unread,
Jul 25, 2017, 1:29:45 PM7/25/17
to blink-dev, n...@chromium.org, igri...@chromium.org
Thank you for pointing that out. Before, the worker's time_origin_ seemed to be set using the window definition, so that was much worse. It seems that we need to accommodate our time_origin_ definition for workers to the order in which we process them. Note that this time_origin_ value is already used used when calling performance.now(), and it will also be used in performance.timeOrigin.

The latest editor draft has an arguably clearer definition, but the meaning seems to be unchanged between both versions.

Ilya Grigorik

unread,
Jul 25, 2017, 10:54:39 PM7/25/17
to n...@chromium.org, blink-dev
Apologies, should have caught this in the intent draft, please refer to definition in: https://w3c.github.io/hr-time/

Rick Byers

unread,
Jul 25, 2017, 11:48:35 PM7/25/17
to Ilya Grigorik, n...@chromium.org, blink-dev
Sounds great Nicolas! 

It looks like the WPTs for hr-time [1] need to be updated for this (IDL test doesn't have it, window-worker-time-origin test doesn't look at it).  Are you planning on doing that as part of this intent?


--
You received this message because you are subscribed to the Google Groups "blink-dev" group.

PhistucK

unread,
Jul 26, 2017, 2:17:01 AM7/26/17
to Rick Byers, Ilya Grigorik, n...@chromium.org, blink-dev
It would be great if you poked WebKit about this and perhaps made sure a WebKit bug is filed. :)


PhistucK

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAFUtAY_egAsLt-m5CgOH7A%2BgR-2xt-ob_Oaj69cWtP%3D6hKFj-Q%40mail.gmail.com.

n...@chromium.org

unread,
Jul 26, 2017, 10:56:12 AM7/26/17
to blink-dev, rby...@google.com, igri...@google.com, n...@chromium.org
If you look at hr-time tests one more time, you'll see a test for it now :) The lack of tests was why I submitted this as intent to Implement without 'Ship'.


Rick Byers

unread,
Jul 26, 2017, 10:59:03 AM7/26/17
to n...@chromium.org, blink-dev, Ilya Grigorik
Awesome :-)
Reply all
Reply to author
Forward
0 new messages