Intent to Ship: First Input Timing

265 views
Skip to first unread message

n...@chromium.org

unread,
Nov 26, 2018, 4:45:13 PM11/26/18
to blink-dev

Contact emails

n...@chromium.org, tdre...@chromium.org  


Explainer

Explainer with processing model includes First Input Timing.


Spec

Spec draft is on the works. TAG review for EventTiming, which includes First Input, is not yet completed.


However, we have received privacy and security reviews at the launch bug


Summary

This intent is only to ship First Input Timing. This API provides developers with timing information about latency of the very first discrete user interaction (key down, mouse down, pointer down followed by pointer up, or click). We propose exposing the PerformanceEventTiming entry for the first input, which contains:

  • The type of the event.

  • The event hardware timestamp.

  • Time when even handlers begin and time when they finish executing.

  • Whether or not the event was cancelable.

We plan to not ship the rendering timestamp at this point (do we shall ship with |duration| set to 0). After some conversation with Microsoft, we decided to do some changes in how we present rendering information in Event Timing and Element Timing. Input delay is defined to be the time when event handlers begin being executed minus the event hardware timestamp, so the API allows computing this for the first input.


Comment on the urgency to ship: we’d like to ship First Input Timing ASAP ahead of the rest of Event Timing because we've been actively promoting First Input Delay (FID) to developers as one of the key metrics to help measure and optimize responsiveness, and as the field companion to TTI. We've been actively promoting it at key developers events (both I/O and CDS), we already surface it in our tools (Lighthouse and PageSpeed Insights), and CrUX exposes it as an experimental metric. To complete the picture, we need to enable RUM providers to gather FID. Even though we’ve extended the Origin Trial for Event Timing, we do not want to block the remaining EventTiming work (for example, implementing event counts correctly) on shipping FID.


Link to “Intent to Implement” blink-dev discussion

Intent to Implement for EventTiming


Origin Trial feedback summary

This section contains Event Timing Origin Trial feedback that is relevant to First Input Timing. One major user said that their event handling framework seemed to prevent them from using the API (injected lag was not being captured in the event timings). In the future we plan to solve this by adding a signal so the developers can tell us when event work is done.


Another major user said that they’d like to use Event Timing to report a more accurate FID than the event-handler based version.


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

Yes.



Debuggability

First Input Timing will be exposed to the Performance Timeline (performance.getEntries…) and could be observed via PerformanceObserver (observer.observe({entryTypes: [‘firstInput’...).


Risks

Interoperability and Compatibility

Event Timing as a whole was presented at TPAC, and the minutes are here. From this, we infer the following:


Edge: Public support

Firefox: Public support

Safari: Hard to say… slight negative signals: expressed general support for solving problem of event latency, but some minor concerns over API shape and security of rendering timestamps.

Web developers: Mostly positive feedback from OriginTrial. Some constructive feedback in terms of what can be improved but no negative feedback against the API itself.


Ergonomics

No ergonomics concerns.


Activation

There is already a polyfill for First Input Timing. This API just makes the information readily available via the Web Platform.


Is this feature fully tested by web-platform-tests? Link to test suite results from wpt.fyi.

Move from http/tests in to external/wpt is progress.


Entry on the feature dashboard

We currently only have a feature entry for Event Timing. Since we plan to ship First Input Timing in advance without the rest of Event Timing, it might be worth creating a separate entry (let me know).


Sadrul Chowdhury

unread,
Nov 27, 2018, 1:52:56 AM11/27/18
to n...@chromium.org, blin...@chromium.org
Hi!

On Mon, Nov 26, 2018 at 4:45 PM <n...@chromium.org> wrote:
[snip] 

We plan to not ship the rendering timestamp at this point (do we shall ship with |duration| set to 0). After some conversation with Microsoft, we decided to do some changes in how we present rendering information in Event Timing and Element Timing.


I am interested to know some details about the plan for measuring the rendering time for Event Timing/Element Timing apis. Is that available somewhere?

Thank you!
Sadrul

Joe Medley

unread,
Nov 27, 2018, 10:09:51 AM11/27/18
to sad...@google.com, n...@chromium.org, blin...@chromium.org
We (DevRel) always encourage a separate entry. 
Joe Medley | Technical Writer, Chrome DevRel | jme...@google.com | 816-678-7195
If an API's not documented it doesn't exist.


--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAKgcGXixY0jbBUqOEiQBeZen4Z1Lzjc-RKRxLVZoMJpG1gnqwQ%40mail.gmail.com.

n...@chromium.org

unread,
Nov 27, 2018, 4:10:47 PM11/27/18
to blink-dev, sad...@google.com, n...@chromium.org
Hi, 


On Tuesday, November 27, 2018 at 10:09:51 AM UTC-5, Joe Medley wrote:
We (DevRel) always encourage a separate entry. 

 

On Mon, Nov 26, 2018 at 10:52 PM 'Sadrul Chowdhury' via blink-dev <blin...@chromium.org> wrote:
I am interested to know some details about the plan for measuring the rendering time for Event Timing/Element Timing apis. Is that available somewhere?

 We will use swap promises, similar to how is done with PaintTiming. For EventTiming, we queue the promises when event handlers have finished running. For ElementTiming, we queue the promises when they are painted from the main thread's perspective. Does that answer your question or did I misunderstand?

On a related note, since we're exposing paint timing information on multiple APIs, we have started discussing in WebPerf how the shape of that API should look like (and what other paint timestamps are valuable to expose). Current draft is here:

Joe Medley

unread,
Nov 28, 2018, 10:38:45 AM11/28/18
to n...@chromium.org, blin...@chromium.org, Sadrul Chowdhury
Thank you.

Joe Medley | Technical Writer, Chrome DevRel | jme...@google.com | 816-678-7195
If an API's not documented it doesn't exist.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

Yoav Weiss

unread,
Dec 3, 2018, 5:01:42 PM12/3/18
to n...@chromium.org, blin...@chromium.org
This gets my +1 (*)
  • The API solves a real problem and will enable sites to get visibility into real-life performance issues caused from Too Much Javascript™. Many developers are today aware of the Time-To-Interactive metrics pushed by Lighthouse and the issues they expose. This will give them visibility into similar issues, but from their users in the wild.
  • Collecting that metric in CRUX enables developers to see these issues exist even if they don't have detailed analytics set up on their site.
  • The metric was throughly discussed and collaborated on with other vendors at the WebPerfWG, and I believe we have buy-in from them on the importance of the use-case and on the API shape (**)
(*) Not LGTMing as I'm too close to this effort
(**) Apple folks were less enthusiastic than the rest regarding the API shape, but I believe their concerns were addressed in the latest changes to the API. Unfortunately they were not present at the latest meeting where these changes were presented.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

Philip Jägenstedt

unread,
Dec 4, 2018, 12:12:39 PM12/4/18
to Yoav Weiss, n...@chromium.org, blink-dev
Hi npm@,

I see that there's no spec yet, and the wpt upstreaming is in progress. Would it be OK to delay this intent until both of those are done, or would that be a problem?

n...@chromium.org

unread,
Dec 4, 2018, 5:18:15 PM12/4/18
to blink-dev, yo...@yoav.ws, n...@chromium.org
Hi Philip,

Tests in WPT: https://github.com/web-platform-tests/wpt/tree/master/event-timing
Spec: https://wicg.github.io/event-timing/

Given these two concerns have been resolved, I would not like to delay this intent.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

Philip Jägenstedt

unread,
Dec 5, 2018, 7:03:01 AM12/5/18
to n...@chromium.org, blink-dev, Yoav Weiss
LGTM1, that was quick :D

I sent a few IDL changes:

In https://staging.wpt.fyi/results/event-timing there is a failure in Chrome Dev, can you check that out?

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

--
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/CACj%3DBEg7m_pSmP29-_Ff1dsAQ7N7MVad3Y85cmgu%3Dovy4sKDCw%40mail.gmail.com.

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

n...@chromium.org

unread,
Dec 5, 2018, 10:34:58 AM12/5/18
to blink-dev, n...@chromium.org, yo...@yoav.ws
Thanks for the contributions, Philip! :) The failure is known and the associated bug is https://bugs.chromium.org/p/chromium/issues/detail?id=831729. It seems to be a problem related to test_driver.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

--
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/CACj%3DBEg7m_pSmP29-_Ff1dsAQ7N7MVad3Y85cmgu%3Dovy4sKDCw%40mail.gmail.com.

Mike West

unread,
Dec 7, 2018, 7:57:10 AM12/7/18
to n...@chromium.org, blink-dev, Yoav Weiss
LGTM2.

-mike


To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

--
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/CACj%3DBEg7m_pSmP29-_Ff1dsAQ7N7MVad3Y85cmgu%3Dovy4sKDCw%40mail.gmail.com.

--
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/966ce76a-75d6-478d-b5b3-663eaa5e2b05%40chromium.org.

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

Chris Harrelson

unread,
Dec 7, 2018, 11:59:27 AM12/7/18
to n...@chromium.org, blink-dev
LGTM3

On Mon, Nov 26, 2018 at 1:45 PM <n...@chromium.org> wrote:

n...@chromium.org

unread,
Dec 12, 2018, 3:48:20 PM12/12/18
to blink-dev, n...@chromium.org
Update: not shipping yet. We've decided to block shipping this on https://bugs.chromium.org/p/chromium/issues/detail?id=914500
LGTM3

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

Annie Sullivan

unread,
May 10, 2019, 4:02:02 PM5/10/19
to n...@chromium.org, blink-dev
Update: we expect to have crbug.com/914500 addressed in M75 and plan to ship in M76.

LGTM3

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

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

Nicolás Peña

unread,
Jun 21, 2019, 3:14:25 PM6/21/19
to blink-dev, n...@chromium.org
This didn't ship in M76 but we will ship in M77. https://bugs.chromium.org/p/chromium/issues/detail?id=914500 may or may not be fixed along with the launch, pending results from a Finch trial.
LGTM3

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
Reply all
Reply to author
Forward
0 new messages