This object is in archive! 
Zooming performance issues when multiple tracks are selected
Solved
Locus zooms very fast now in general. However, when multiple tracks (or map items) are selected, the zooming performance suffers a lot (eg from a >50fps down to 3fps). That also happens when the selected tracks are thousands of miles away and not even close to being visible.
The scrolling performance does not seem to be affected by selected invisible tracks. Only zooming becomes slow.
Tried with latest 2.5.4.2 testing version.
hmm currently I see no simple solution for this. One problem (probably mainly in your case) was! slow zooming in high zooms on huge RMAP maps. This should be fixed in next version.
When you zoom, all tracks, visible or invisible on screen, have to be recomputed to new map projection of current zoom, so it takes some time. (they have to be recomputed because without this, I don`t know if they`re visible in new zoom or not) Unfortunately I`m doing this in main application thread so it lower performance if you have a lot of tracks. It should be much faster now then it was around a month ago, but I know it`s still not best
hmm currently I see no simple solution for this. One problem (probably mainly in your case) was! slow zooming in high zooms on huge RMAP maps. This should be fixed in next version.
When you zoom, all tracks, visible or invisible on screen, have to be recomputed to new map projection of current zoom, so it takes some time. (they have to be recomputed because without this, I don`t know if they`re visible in new zoom or not) Unfortunately I`m doing this in main application thread so it lower performance if you have a lot of tracks. It should be much faster now then it was around a month ago, but I know it`s still not best
I understand. The problem is most visible when using pinch&zoom obviously, where Locus can be either superfast or superslow and there is no apparent reason for it on screen. For example, I enabled all camino santiagos of Spain as mapitems last week and then completely forgot about it. I was confused for several days why pinch&zoom in Germany was slow.
Recomputing tracks in another thread might be ideal. Immediately stop & restart that sub-thread with new values when the user keeps zooming. I know this is not an easy solution, programmingwise.
Another idea, less elegant but maybe simpler to implement: While pinch-zooming is in progress, you only recalcultate the tracks that were on screen when the pinch-zooming operation started. Only when the user stops pinch-zooming (or pauses it for a moment), you recalcuate all enabled tracks.
The second suggestion means that we would always have speedy pinchzooming, but newly visible tracks would only appear on screen when pausing for a split second or stopping pinch-zoom. Sounds reasonable imho.
Oh... also... you do not need to recalculate non-visible tracks at all when zooming in! New stuff can only appear when zooming out.
I understand. The problem is most visible when using pinch&zoom obviously, where Locus can be either superfast or superslow and there is no apparent reason for it on screen. For example, I enabled all camino santiagos of Spain as mapitems last week and then completely forgot about it. I was confused for several days why pinch&zoom in Germany was slow.
Recomputing tracks in another thread might be ideal. Immediately stop & restart that sub-thread with new values when the user keeps zooming. I know this is not an easy solution, programmingwise.
Another idea, less elegant but maybe simpler to implement: While pinch-zooming is in progress, you only recalcultate the tracks that were on screen when the pinch-zooming operation started. Only when the user stops pinch-zooming (or pauses it for a moment), you recalcuate all enabled tracks.
The second suggestion means that we would always have speedy pinchzooming, but newly visible tracks would only appear on screen when pausing for a split second or stopping pinch-zoom. Sounds reasonable imho.
Oh... also... you do not need to recalculate non-visible tracks at all when zooming in! New stuff can only appear when zooming out.
After thinking about it some more, I apparently dont understand another thing: Every track stores its bounding box (min & max latitude/longitude) somewhere I assume? It should be a matter of microseconds to check this bounding box against the current screen and simply DO NOTHING when it is outside.
Just flag the track data as "unclean/needsrecalc" on zooming and do whatever needs to be done when the track comes into view. Not earlier.
Not only should that speed up Locus a lot, but it will also save plenty battery power by preventing many unnecessary calculations. Because when you pinch&zoom with off-screen tracks now, all the things you calculate are simply invalidated in the next millisecond when the users keeps zooming.
After thinking about it some more, I apparently dont understand another thing: Every track stores its bounding box (min & max latitude/longitude) somewhere I assume? It should be a matter of microseconds to check this bounding box against the current screen and simply DO NOTHING when it is outside.
Just flag the track data as "unclean/needsrecalc" on zooming and do whatever needs to be done when the track comes into view. Not earlier.
Not only should that speed up Locus a lot, but it will also save plenty battery power by preventing many unnecessary calculations. Because when you pinch&zoom with off-screen tracks now, all the things you calculate are simply invalidated in the next millisecond when the users keeps zooming.
yes I was also thinking about correct checking of bounding box. It`s also not so simply but I think it should work. I`ll check it to next version
yes I was also thinking about correct checking of bounding box. It`s also not so simply but I think it should work. I`ll check it to next version
Two years have passed meanwhile and zooming performance is still a major issue: Have a few dozen tracks enabled in Peru and Locus slows to a crawl while pinch & zooming around in totally unrelated parts of the world, eg. in Germany.
Two years have passed meanwhile and zooming performance is still a major issue: Have a few dozen tracks enabled in Peru and Locus slows to a crawl while pinch & zooming around in totally unrelated parts of the world, eg. in Germany.
Still unsolved. Import http://www.adventurecycling.org/default/assets/file/KML/overview/ACA_Network_03_26_15.kmz and then move back to your home town and zoom to your favorite bar. Sooooooooooooo slow :).
Still unsolved. Import http://www.adventurecycling.org/default/assets/file/KML/overview/ACA_Network_03_26_15.kmz and then move back to your home town and zoom to your favorite bar. Sooooooooooooo slow :).
If you promise to use separate threads for everything remotely "expensive", I will gladly wait another two years... :-)
If you promise to use separate threads for everything remotely "expensive", I will gladly wait another two years... :-)
Hello Stephan,
very old topic with one very important task: performance improvement.
Over the last years, in the app were many changes regards how items are drawn on the map. Performance is currently not a major problem I believe, but it is a permanent task that is always worth the time. With this, I'm closing this old task. Thanks for the contribution and necessary pushes!
Jiří M. aka Menion
Hello Stephan,
very old topic with one very important task: performance improvement.
Over the last years, in the app were many changes regards how items are drawn on the map. Performance is currently not a major problem I believe, but it is a permanent task that is always worth the time. With this, I'm closing this old task. Thanks for the contribution and necessary pushes!
Jiří M. aka Menion
Replies have been locked on this page!