react-infinite icon indicating copy to clipboard operation
react-infinite copied to clipboard

scrolling isn't hardware accelerated due to hooking onScroll event

Open dustingetz opened this issue 10 years ago • 13 comments

To address this we can't hook the onScroll event. I think we could poll the scroll state in a timeout, or on requestAnimationFrame or every 100ms or something. Just need to configure a wide-enough visible range, so 100ms of scrolling doesn't go past the visible elements. I may be wrong, I haven't given this enough thought yet.

I can feel the difference removing the onScroll hook on my 2014 macbook pro in chrome canary - things feel snappier and slightly less clicky. The effect is minor - I never noticed the degraded perf before.

dustingetz avatar Aug 13 '15 15:08 dustingetz

I am attempting to address this in my fork - if i get it working, this fix can probably be back-ported.

dustingetz avatar Aug 13 '15 15:08 dustingetz

:+1: I think requestAnimationFrame might be the way to go here.

Polyrhythm avatar Aug 13 '15 16:08 Polyrhythm

@dustingetz did you make a pull request? I would be interested in checking it out.

diffractometer avatar Sep 16 '15 22:09 diffractometer

I haven't had time to submit a PR to this project, but you can see what I did in my fork here: https://github.com/dustingetz/react-infinite/blob/master/src/react-infinite2.jsx#L93

dustingetz avatar Sep 17 '15 14:09 dustingetz

I will eventually submit a PR to this project, its just may be a month or two.

dustingetz avatar Sep 17 '15 14:09 dustingetz

Cool, thanks for the update. I will keep one eye on the project!

On Thu, Sep 17, 2015 at 9:38 AM, Dustin Getz [email protected] wrote:

I will eventually submit a PR to this project, its just may be a month or two.

— Reply to this email directly or view it on GitHub https://github.com/seatgeek/react-infinite/issues/63#issuecomment-141106740 .

diffractometer avatar Sep 17 '15 16:09 diffractometer

I'd really like to get this in as well. We're a little busy at the moment, but I'll try and get some time to do it soon.

garetht avatar Sep 17 '15 16:09 garetht

+1 for implementing requestAnimationFrame

webyak avatar Nov 02 '15 10:11 webyak

ugh, this is almost a year old, no progress?

jasongonzales23 avatar Sep 15 '16 01:09 jasongonzales23

@jasongonzales23 submit a PR if it's important enough to lament with an 'ugh' brah.

diffractometer avatar Sep 15 '16 18:09 diffractometer

Fair enough, apologies, was just having a very frustrating day at the time. If you're in SF I'd be happy to buy you a beer or two to make it up to you 🍻

jasongonzales23 avatar Sep 15 '16 19:09 jasongonzales23

@jasongonzales23 No worries. I'm just a troll who uses this project, not the author and I've been there. If you're in Chicago I will buy you a beer.

diffractometer avatar Sep 15 '16 20:09 diffractometer

See, we aren't a country divided afterall. Take that politicians...

jasongonzales23 avatar Sep 15 '16 20:09 jasongonzales23