performancecore-web-vitalsinteraction-to-next-paint

How do I check more details of a long task in my Web Devtools Performance panel?


I'm trying hard to improve my INP score (from around 50).

I tried almost everything, but still couldn't work. Latest data from Cloudflare shows the same though I've even removed some features.

So I am using the Performance panel to detect those long tasks. I know that long tasks are key to optimize INP.

However, for this one, how can I dive into more details? Is the long task due to jquery itself (so I need to use vanilla js instead of jquery)? Or is the long task due to my bad use of $() function?

Is there any detailed tutorial on how to read the Bottom-Up report? Can somebody give me some help?

Thanks!

enter image description here


Solution

  • There's two ways you could start diving into this.

    Bottom-Up tab

    The entries are all summed up from the bottom of the call stack, so you're really interested in the Self Time column, not Total Time, since you want to find out the specific place that time was being spent (Self Time), not where time was being spent if you include time spent in any other code called within that time (Total Time).

    So the readystatechange event handled within jquery was the root of a bunch of (total) time spent, but almost no (self) time occurred within the jquery code. It was the entry point but then immediately called whatever listener you (or a library) registered to fire on ready. That Function Call block at the top of the list has 91.9% of the Task time in its self time, so whatever that is, that's the culprit. Unfortunately there's no source link to click through and see what it was.

    Flame chart

    So that Function Call taking up most of that part of the flame chart matches what the Bottom-Up view says. If you click on it in the flame chart and look in the "Summary" tab instead of the "Bottom-Up" tab, you'll get a few details. Usually a link to the source that ran in that time will be in there too, and you'll be able to see what code was running.

    If there's not a link, though, I'd suggest

    Just beware there could be more than one function called back by $(document).ready(), but (in this case) it appears only one function is taking a ton of time.