standards-positions icon indicating copy to clipboard operation
standards-positions copied to clipboard

Long Tasks API

Open BenjaminHarding opened this issue 3 years ago • 5 comments

Request for position on an emerging web specification

Information about the spec

  • Spec Title: Long Tasks API
  • Spec URL: https://w3c.github.io/longtasks/#sec-PerformanceLongTaskTiming
  • GitHub repository: https://github.com/w3c/longtasks/

Design reviews and vendor positions

  • TAG Design Review: https://github.com/w3ctag/design-reviews/issues/150
  • Mozilla standards-positions issue: https://github.com/mozilla/standards-positions/issues/171
  • Chrome Platform Status: https://chromestatus.com/feature/5738471184400384

BenjaminHarding avatar Aug 30 '22 06:08 BenjaminHarding

cc @achristensen07 @rniwa

hober avatar Sep 01 '22 18:09 hober

The main challenge with this API is that there isn't really any centralized scheduling system in WebKit. We need to complete the refactoring & integration of the HTML5 event loop before we can have a meaningful description / attribution as to what took long.

rniwa avatar Sep 11 '22 19:09 rniwa

Thanks for the context @rniwa.

For our use-case, we don't really use the attribution portion of the spec and find that the most important part is knowing when & for how long the UI thread was blocked. We correlate this information with our internal analytics systems to have a general understanding of what was happening when the task occurred.

Would delaying the attribution portion help to ship a basic version faster?

BenjaminHarding avatar Sep 13 '22 00:09 BenjaminHarding

Would delaying the attribution portion help to ship a basic version faster?

Not really. The main issue here is that WebKit doesn't have an easy mechanism to keep track when the main thread was busy and for how long.

rniwa avatar Sep 15 '22 18:09 rniwa

Some initial thoughts:

  1. The name of the API should be "Long tasks reporting" or "Long tasks detection" or "Long tasks performance entries". This isn't really a new API, it's just new reporting.
  2. Some of the points in https://w3c.github.io/longtasks/#priv-sec dont' seem to be correct any more with process-per-site; I think some of the cross-origin cases can't easily be detected without this API, so there is some new information leakage here.
  3. "A pause between the last step and the next first step of the event loop processing model. This captures any work that the user agent performs in its UI thread outside of the event loop.": not sure web pages have any business knowing what the user agent is doing.

smfr avatar Oct 18 '23 00:10 smfr