Web-vitals extension giving INP values for scroll event.

257 views
Skip to first unread message

Abhishek Chaudhary

unread,
Aug 10, 2023, 7:34:33 AM8/10/23
to web-vitals-feedback
Hi all,
I hope this mail finds you well. I am trying to find the INP values for my page for various interactions using the web vitals extension. But I have found out that this extension also gives NIP values for scroll events with the processing time being reported as zero always.
I have also attached a photo for your reference.

Screenshot 2023-08-10 165934.png
Please give your valuable input on this. Is it an issue with the extension or at my end??

Regards
Abhishek Chaudhary

Barry Pollard

unread,
Aug 10, 2023, 8:31:55 AM8/10/23
to Abhishek Chaudhary, web-vitals-feedback
As noted in our docs:

Important

Hovering and scrolling does not factor into INP. However, scrolling with the keyboard (space bar, page up, page down, and so forth) involves a keystroke, which may trigger other events that INP does measure. Any resulting scrolling is not factored into how INP is calculated.

I just testing this out locally using this quick demo page: https://www.tunetheweb.com/experiments/scroll-demo/
I don't see any long interactions being logged for mouse scrolls, nor for keyboard-driven scrolls (e.g. Page Down, Page End...etc.) nor by clicking on the scrollbar, during the time the long interaction is happening. They are all 16ms or 24ms, if they even are logged (they don't get logged if less than 16ms).

Scrolling happens off the main thread in most cases, unless there are scroll event handlers or similar, so is it possible your page has event handlers linked to the scrolling such as Intersection Observers?

Thanks,
Barry



--
You received this message because you are subscribed to the Google Groups "web-vitals-feedback" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web-vitals-feed...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web-vitals-feedback/99fd9c12-9a3d-4e21-9893-7dceef2becf4n%40googlegroups.com.

Abhishek Chaudhary

unread,
Oct 5, 2023, 5:29:55 AM10/5/23
to web-vitals-feedback
Hi,
I have observed that I am getting values for INP for scrolling only when I quickly scroll down my page during the initial load of the page.
Upon profiling the scroll during page load I found out that the initial loading/evaluation of the scripts is contributing to the input delay.
Screenshot 2023-10-05 145408.png
but again I have a question as scrolling happens off the main thread then why is it contributing to input delay??

Screenshot 2023-10-05 145924.png

Thanks 
Abhishek

Abhishek Chaudhary

unread,
Oct 5, 2023, 5:36:25 AM10/5/23
to web-vitals-feedback
Also, we do have a lot of event listeners attached to the scroll event.
In most cases, we are calling the js files on scroll which are not needed in the first fold.
So should we avoid doing so??
Is there any better approach??

Thanks 
Abhishek

Michal Mocny

unread,
Oct 5, 2023, 11:01:12 AM10/5/23
to Abhishek Chaudhary, web-vitals-feedback
Continuous, raf-aligned events, like pointermove or scroll events, are not measure by Event Timing and are not measured by INP.

The event you show in the screenshots above does show that the event type is "Pointerdown" which is the first event from a mouse click / touch tap.  On touch devices we are not initially sure if a pointerdown will turn into a scroll or a tap, and so we start by measuring it, buffer the data, and then figure it out later and either measure or discard.

It is of course possible that for some reason, this scroll is being measured as a discrete event.  For example, if you are driving the scroll yourself rather than letting the compositor drive scroll behaviour, then it will count as a pointer interaction.  Or maybe we got measurements wrong here for some reason.  But looking at the screenshot of your trace, it seems also possible that it was just an accidental spurious click?

Could you share a trace which reproduces the issue?  I'd like to look at some of the events in more detail.


Michal Mocny

unread,
Oct 5, 2023, 11:21:28 AM10/5/23
to Abhishek Chaudhary, web-vitals-feedback
Alright, I spent some time on the site and I do think there is something wrong with tracing.

The events seem to not get reported to Event Timing performance observers, but they do appear in TRACE data and also affect performance.interactionCount.

It does only happen very early in page lifecycle which I wonder is just related to main thread contention, and perhaps that is related to scroll events and passive mode fallback.

Thank you for the report!
Reply all
Reply to author
Forward
0 new messages