w3c / long-animation-frames

Long Animation Frame API specification repository
Other
10 stars 1 forks source link

[LoAF] Should it be easier to link LoAF to INP entries #5

Open tunetheweb opened 1 year ago

tunetheweb commented 1 year ago

Been discussed a bit internally with the Chrome team, but here's a public issue to track and discuss this.

Currently LoAF is a separate view of Performance Timeline entries, meaning there is no direct link to an INP entry. As one of the primary reasons for this new API was as a tool for improving responsiveness (as measured by INP) should it be easier to get the LoAF entries for an INP entry?

Currently, this requires quite a lot of processing (example WhyNP script).

noamr commented 1 year ago

The way I see it (and reflecting some internal team conversations with @mmocny and @tdresser), bad responsiveness can be caused by:

  1. long event processing. event timing already captures this. Scripts that correlate between the entries can help here as well to give you more attribution that LoAF provides.
  2. compositor congestion, which delays both input and paint. LoAF doesn't help there.
  3. General main-thread congestion. This is where LoAF is useful regardless of INP/event-timing: if your main thread is running a lot of things in a blocking way, it has a high chance to fall on one event or another, and capturing exactly which event fell on which LoAF is perhaps a bit of a red herring.

So for someone that's debugging INP, it would be best to start by understanding which kind of problem they have out of the (3), and see if correlating the exact event-timing entry with LoAF is what would help them with that.

vegerot commented 10 months ago

The main reason we're adding LoAF is to better explain INP entries. Adding an explicit link between an INP entry and its LoAF sounds logical.

lebreRafael commented 10 months ago

@noamr based on what you said it seems that more important than linking LoAF to INP would be to breakdown the 3 phases of INP (Input delay, Processing time and Presentation delay). Is it possible to do that with the current APIs? I know we can see that in chrome devtools but It would be good to track it in RUM

noamr commented 10 months ago

@noamr based on what you said it seems that more important than linking LoAF to INP would be to breakdown the 3 phases of INP (Input delay, Processing time and Presentation delay). Is it possible to do that with the current APIs? I know we can see that in chrome devtools but It would be good to track it in RUM

Event timing gives you precisely that breakdown, yes.