-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Maplibre dynamic image loading #546
Maplibre dynamic image loading #546
Conversation
…n thread all the time
For me the startup time does not appear improve. Measuring the time between Memory use is much better, native is now 36 MB after startup (not showing pins). |
Well, I guess, naturally, if the time it takes to come up is 4.2s on the main thread, then there is this much room for things to be done on other threads before it would positively impact startup time. You wrote that the image generation takes 2.8s on your phone - as it starts immediately when the app starts in a background thread, the image generation should have no or very little impact. Until we find a way to reduce the startup time below that, but it looks like most of that would be up to MapLibre people. |
Ah, I should have tested the release build. Here the startup time is clearly faster, reduced from 2.9 s to 1.3 s for the same time the debug takes 4.2 s. |
I got a crash when I tried to open the release build again:
It's probably not related to this PR, but possibly to using a release build where "unused" classes are removed. |
I think to fix this, you need to do a rebuild. |
I implemented the dynamic image loading. If this turns out to be useful, maybe I should make other methods of *Components suspending, too, for consistency.
Some coarse quick performance tests on my phone:
On my phone, loading all images up-front took 2.0s. Posting all these to Maplibre (
addImages
) took on average 0.25s. ConvertingPin
andStyle
data structures to MapLibre features when loading more data into the layer took on average only about 0.02s with overlay on - this is why my earlier suggestion to move this onto a background thread by making this suspending didn't turn out to have any noticeable effect.With this change, no images are loaded up-front, but instead on first display of data (in the background, one by one). It "feels" as if the startup is faster, but I didn't measure anything.
I didn't look at the memory.
What do you think?