tether icon indicating copy to clipboard operation
tether copied to clipboard

touchmove handler can impact scroll performance

Open RByers opened this issue 10 years ago • 3 comments

I work on chromium and was investigating scroll performance on time.com and that led me to the tether.js code that adds a touchmove listener. touchmove (and wheel) listeners can have a substantial impact on scroll performance. I'd like to understand the use cases here so we can help improve the web platform to avoid the performance implications.

Can you help me understand what tether.js's touchmove listener is doing? To me it appears to (along with the scroll and resize listeners) cause the positions of elements to be updated. But shouldn't scroll and resize be enough on their own? I certainly can't think of any scenario where you'd get a touchmove that moves things around without also a scroll (except maybe during pinch-zoom)?

We hope to be adding tooling to Chrome devtools to better help site owners blame specific scripts for scroll performance issues. If, as I suspect, the touchmove listener in tether.js isn't providing any real value, then hopefully you can just remove it. But if it is, then I'd like to better understand the scenario so we can help address it (maybe with passive event listeners?)

RByers avatar Oct 14 '15 20:10 RByers

I certainly can't think of any scenario where you'd get a touchmove that moves things around without also a scroll (except maybe during pinch-zoom)?

You'd think that would be covered by the resize listener.

crabmusket avatar Nov 02 '16 12:11 crabmusket

Updates? passive event listeners are landed in modern browsers.

breezewish avatar Feb 27 '17 09:02 breezewish

@RByers your logic seems sound to me, that scroll should be enough. I would be in favor of removing touchmove I think. We would need to ensure that scroll is sufficient first though.

RobbieTheWagner avatar Feb 20 '20 02:02 RobbieTheWagner