Skip to content

Yew blocks the main thread often while processing tasks #4032

Description

@Ddystopia

Problem

Yew's scheduler, while processing tasks, doesn't yield to the main thread for a long time. It can cause various problems, such as web page being unresponsive.

Further reading: https://web.dev/articles/optimize-long-tasks?utm_source=devtools

Steps To Reproduce
Have a big enough application, there will be enough tasks so from time to time yew would stall the main thread while processing tasks.

Expected behavior
Yew's scheduler would yield to main thread from time to time.

Screenshots

Image

Another one, with explicit warning:
Image

Environment:

  • Yew version: 0.21.0
  • Rust version: 1.94.0-nightly
  • Browser and version: Chromium 144.0.7559.132

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions