Page MenuHomePhabricator

Try out the Long Task API
Closed, ResolvedPublic

Description

One thing that could be nice for us to try out is the
https://github.com/w3c/longtasks API

Long Tasks is a new real user measurement (RUM) performance API to enable applications to measure responsiveness. It enables detecting presence of “long tasks” that monopolize the UI thread for extended periods of time and block other critical tasks from being executed - e.g. reacting to user input.

It is enabled by default in Chrome 58.

Event Timeline

Gilles triaged this task as Medium priority.Jun 21 2017, 1:33 PM

Seems like adding long tasks can break Firefox if we aren't careful: https://bugzilla.mozilla.org/show_bug.cgi?id=1398477

Maybe we can add this to the Performance inspector?

Experimenting locally, I can trigger it when opening VE on a cold cache, but not with a warm cache.

We can add it to PerformanceInspector's startup module, but that doesn't run early enough to catch things that have to do with our page startup. Still good to find issues in things people interact with after the initial pageload.

Change 377984 had a related patch set uploaded (by Gilles; owner: Gilles):
[mediawiki/extensions/PerformanceInspector@master] Observe long tasks and report them in the console

https://gerrit.wikimedia.org/r/377984

What about do a WebExtension that do this? Then we can inject it really early.

Change 377984 abandoned by Imarlier:
Observe long tasks and report them in the console

Reason:
Implemented in Chrome devtools already

https://gerrit.wikimedia.org/r/377984

Imarlier claimed this task.
Imarlier subscribed.

CHrome did this (yay!)