Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Chrome setTimeout throttling #722

Closed
tobiashort opened this issue Jul 5, 2017 · 7 comments
Closed

Fix Chrome setTimeout throttling #722

tobiashort opened this issue Jul 5, 2017 · 7 comments

Comments

@tobiashort
Copy link

Hi there.

We have faced a scrolling issue using react-virtualized table with the Chrome browser. After scrolling with the mouse wheel, we experience a quite long time of 1.5 to 2 seconds for which our web application stops responding as we would expect. However this issue does not occur when moving the scroll bar. We also experienced better performance in other browsers, e.g. Firefox.

Performance profiling in Chrome showed us, that after a scroll event the timer does not fire as expected after 150ms (how it is implemented, see DEFAULT_SCROLLING_RESET_TIME_INTERVAL in Grid.js) but after 1.5 seconds or even more.

screenshot-1

We researched for an explanation and found a similar issue explained in this bug report
https://bugs.chromium.org/p/chromium/issues/detail?id=570845

It seems that this is not a bug, but a feature of Chrome.
I followed the advice at the very end of the bug report and replaced the setTimer with requestAnimationFrame and clearTimer with cancelAnimationFrame (see also my fork on https://github.com/uglywizkid/react-virtualized/blob/master/source/Grid/Grid.js ). This seems to result in much better performance.

A fix in your library would be very appreciated

@bvaughn
Copy link
Owner

bvaughn commented Jul 5, 2017

A fix in your library would be very appreciated

A PR would be a good start to getting said fix into RV.

@tobiashort
Copy link
Author

Any chance you could fix your project first? Your build is failing. In this case it is hard for me to check whether my changes break other things.

@bvaughn
Copy link
Owner

bvaughn commented Jul 6, 2017

Use yarn install locally and things should work fine. CI started failing recently for reasons unknown. I am unable to reproduce the failure locally, and I don't have time to dig into it. I maintain a lot of projects and I'm kind of swamped at the moment.

If you want to get his change into RV- I'm supportive. But I'm asking for help in the form of a PR b'c I'm too overloaded to do it myself right now. 😄

@bvaughn
Copy link
Owner

bvaughn commented Jul 15, 2017

CI is passing again. Upgraded Circle from Ubuntu 12 -> 14 and that seems to have resolved the test issue.

@TrySound
Copy link
Contributor

@uglywizkid Will this behaviour be fixed with #742?

@giuseppepaul
Copy link

Hey guys, ran into this issue too, was driving me mad so thanks for the explanation @uglywizkid

Any news on when a fix for this will be available?

@bvaughn
Copy link
Owner

bvaughn commented Aug 18, 2017

Fixed via #742. Will go out in the next release.

@bvaughn bvaughn closed this as completed Aug 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants