WIP: asset/album sync within an isolate #10668
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
I've had a problem with my phone locking up, and suspected it's the number of assets being synced - #10030.
Looking at the code, it seems to be done on the UI thread. Isar has a recipe for multi isolate usage
I played around a bit with isolates (first time using it) and uploaded a profile build to my phone.
There's a lot less visual jank whilst the assets/albums are syncing. Importantly, the app doesn't permanently freeze anymore.
Have to say it's not without problems, the search page does some kind of syncing and it doesn't display properly at the moment, but i'm sure that's fixable.
Working in isolates is a bit challenging as the app has shared states. To that extent, I wasn't sure if the hashingService does something sequentially, which might pose a roadblock to this PR.
The demo server doesn't reproduce this problem, otherwise I would have made a demo video comparing before/after. I wonder if you could run the code and use the dart tools to measure FPS on a larger(than the demo) server so that you can see the impact.
It's currently a bit all over the place, just to test/validate the problem...