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

[Web] Using CircularProgressIndicator stalls database transactions on slow machines #311

Open
felix-ht opened this issue Apr 14, 2022 · 2 comments

Comments

@felix-ht
Copy link

felix-ht commented Apr 14, 2022

If one uses the CircularProgressIndicator all database inertaction are much slower. This is much more pronounced on slow machines and on the web.
If large amounts of data are written to the db or the db is initially opened (with data stored), this can change response times from seconds to multiple minutes.

Might be related to this:

flutter/flutter#73766

This is especially easy run into because showing a spinner while some interaction is running is pretty typical.

@alextekartik
Copy link
Collaborator

Thanks for the report, indeed sembast run in the main isolate so can be slow down if heavy UI is running (which is maybe the case for the circular progress indicator). I don't think it is related with the flutter bug you point too.

sembast has a weird concept of cooperator to allow heavy computation (sort, query, write) in the main isolate and let other pending ui task run using some timing and pauses

Some info:

What you can try is to disable the cooperator, the risk being that the UI may hang for heavy database operation or to tune the timing parameters (unfortunately I don't have good clue, the experiment was made using Chrome on Android).

@felix-ht
Copy link
Author

Thanks I will test disabling the cooperator!

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

2 participants