-
Notifications
You must be signed in to change notification settings - Fork 366
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
Got UI stuck when writting data to SQL #3138
Comments
Does this happen for any query or only for large batches/queries with lots of rows? Building SQL and interpreting results still happens on the main isolate, and in some cases that can be costly. If you have more information about the kind of queries that you're running which might slow things down, I can suggest some mechanisms to move these onto other isolates as well. |
Hello, I merely have a stream that listens to all data. Every time new data arrives, the stream would update and subsequently update the UI. As of now, when I insert a single piece of data, the UI becomes stuck. I am not certain if this occurs due to my listening to the stream. However, if I do not listen to it, the UI will not update when data is inserted. |
Does it jank for a frame or 2, or does the app freeze. A stream which has no listeners doesn't issue events, try adding adding a listener to the stream manually and see what happends
A code sample and a screen recording are needed to further diagnose this |
Hello, I believe it is caused by my listening to the stream all at once (without applying a limit), which implies that it queries all at once for each instance, approximately 1000 records every single time. Do you think this will result in a significant amount of compute overhead? What is the most optimal approach to handle this? Is the application of a limit necessary? |
If you are performing multiple mutations rapidly, use a transaction so that the query only reruns once all the actions are done |
@dickermoshe I just inserted a single record, and the listened stream got update, stuck UI. |
Nah, we’re gonna need more code.
Could you post the code for the database class?
Also, can you profile the app and upload the CPU flame chart
…On Tue, Aug 13, 2024 at 11:30 PM MagicSource ***@***.***> wrote:
@dickermoshe <https://github.com/dickermoshe> I just inserted a single
record, and the listened stream got update, stuck UI.
is a single record also compute densely
—
Reply to this email directly, view it on GitHub
<#3138 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASDJ6224O3NWGC4Z4PKBAUDZRLFMTAVCNFSM6AAAAABMJPFIW2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOBXG43DQNBTHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I have using used
NativeDatabase.createInBackground
created the database, but still, when inserting data to DB, the UI will stuck.Is there any else reason could lead to this?
The text was updated successfully, but these errors were encountered: