-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
This is cross-posted issue from gatsbyjs/gatsby#12520
Description
In Chrome DevTools using the FPS meter, the scroll listener that Gatsby seems to add causes poor scrolling performance. I noticed this on my website and on React's website. I don't add a scroll listener anywhere so I guess it's coming from Gatsby.
Steps to reproduce
- Visit atomiks.github.io/tippyjs
- Open FPS Meter in Chrome DevTools
- For me it's showing ~45 - 55 FPs with lots of frame drops and stuttering
- Type this into the console
getEventListeners(window).scroll.forEach(({ listener }) => { window.removeEventListener('scroll', listener) })
- Much improved scrolling, way less frame drops once the listener has been removed.
Before: gyazo.com/57edc6fb31e1e06725f7e31c3b2a51a0
After: gyazo.com/3b4070170309a1c0037272a3cb3d3d17
I don't have any context on internals of scroll-behavior package, but maybe adding some debounce to listener function could help?
/cc @atomiks
Metadata
Metadata
Assignees
Labels
No labels