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

[Schedule]Low priority updates block high priority updates #13597

Closed
koba04 opened this issue Sep 8, 2018 · 1 comment
Closed

[Schedule]Low priority updates block high priority updates #13597

koba04 opened this issue Sep 8, 2018 · 1 comment

Comments

@koba04
Copy link
Contributor

koba04 commented Sep 8, 2018

TimeSlicing is a great feature, thank you for your great works!
I've been enjoying it, but I have a problem with its scheduling.

I know the scheduler is unstable, this issue is just to tell you a prblem I have.

The problem:

If I have high priority updates and many low priority updates, low priority updates interrupt and block the high priority updates.

How to reproduce:

You can imagine the app is like a spreadsheet app.

You can recognize that low priority updates block high priority updates.
I guess that will become a huge problem with IME composition events.
(Try to type "こんにちは(konnnitiha)")

The following is a timeline I've measured.

screen shot 2018-09-08 at 13 13 26

The source code is here.
https://github.com/koba04/react-timeslicing-demo

The previous version that used requestIdleCallback didn't have the problem.
Because requestIdleCallback runs a registered callback only when the UI thread is idle.

The following is a version that uses requestIdleCallback.

https://react-timeslicing-demo.netlify.com/

screen shot 2018-09-08 at 13 16 16

Should I implement another way to avoid to block high priorities by low priorities?

@koba04
Copy link
Contributor Author

koba04 commented Oct 26, 2018

The problem was solved with react@16.7.0-alpha.0.
That's great!

Here are a link and a performance timeline.

https://deploy-preview-2--react-timeslicing-demo.netlify.com/

screen shot 2018-10-26 at 3 58 56

But the latest version takes long times to change the input range.
I'll close this issue because it's another issue.

The result seems to be caused by calling getHostSibling from commitPlacement.

Here is a performance timeline.

screen shot 2018-10-26 at 4 41 25

You can recognize the difference between v16.4 and v16.7.0-alpha at the following links.

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

1 participant