-
-
Notifications
You must be signed in to change notification settings - Fork 957
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
Setting a thousand of artworks takes a lot of time #623
Comments
We've removed the unconditional logging (it is now tied behind |
Avoid overloading ContentObservers with individual insert/update/delete Uris and instead only notify on the root content URI. Found that this improves the cases found in #623 even more.
Rather than doing the delete operations on a row by row level as a separate batch operation, apply it as part of the same set of operations using selection criteria. Found that this improves the cases found in #623 even more.
Just tried 3.4.0 — the improvement is here, thanks! However, I’ve increased the artworks count to 2600+ and there is still a visual pause. It’s not as bad as it was though:
These numbers are from Google Pixel 3a with Android 10 onboard. Timings were taken from the Not sure if it’s possible to optimize this further. |
The title sounds ridiculous but it is true.
Since the source I’m working on contains a limited set of images I ship a defined set of declarations in JSON. It contains something like 1500 elements. I read this JSON, transform it to
Artwork
objects and callMuzeiArtProvider#setArtwork
. It works fine but there is a noticeable delay before images actually appear on the UI. It might take almost a minute to do so (on a real device). Timings from an emulator:Artwork
MuzeiArtProvider#setArtwork
One thing I’ve noticed right away is a ton of such log entries:
Not sure it is necessary to occupy the thread with logging 1.5 K entries, especially taking into account
Uri#toString
calls. But the real issue is somewhere else and it occupies the majority of time.The text was updated successfully, but these errors were encountered: