This object is in archive! 

'Show view' + 'Map color mode' on double rendering time

Martin Lichtblau shared this problem 2 years ago
Not a Problem

Problem: When the 'Show view' and 'Map color mode' features are enabled and the orange view graphic is visible on the screen the rendering performance drops harshly which harms UXP.

System: This happened on a Pixel 3a in both Locus 3 and 4.

Evidence: By activating the "Profile HWUI rendering" setting in Android developer options you see that rendering time doubles, mostly because 'Misc' and 'Draw" time increase when orange view is visible on screen.

P.S.:
- It doesn't matter whether which coloring mode is on.
- Even if the orange view graphic isn't visible the Map coloring feature harms performance a lot. Is it perhaps running on the UI thread and thus the rendering time increase? Even map overlays and shading harm performance less.

Replies (8)

photo
2

Hello Martin,

very good observation with profiler. Reason is simple. App use method called "PorterDuffXfermode". This is not supported by hardware renderer so indeed, both map layers are in moment you enable any! blend mode, rendered by software renderer => it has, as you mentioned, terrible effect on the performance.

I'm already for many years playing with the idea to completely remove option to set a blend mode. Maybe it is a time to think more about it.

So generally, this is not a problem. More a technical limitation.

Jiří M. aka Menion

photo
1

Thanks for the insight. I didn't know that Map Color Mode is similar to the map overlay blend modes. I know that it's impossible to set any of these modes, since then Locus becomes stuck or even crashes. If this is normal, then of course the blend modes (in map overlay) should be removed.

However, I didn't activate any blend mode. I am talking about the separate map color mode feature. The performance drop I talk about happens mainly when 'Map color mode' is on and is made much worse in combination with the 'Show view' feature ‒ nothing to do with map overlay or blend mode. But if I get it correct, both color and blend mode use similar functions in the background.

I find the the map color mode useful to increase contrast and thus achieve better visibility to see esp. fine trails better when being outdoors. So I would like to see this feature stay and with better performance if possible. Perhaps nowadays exists a better technical solution, e.g. Blendmode. Certainly the map color mode doesn't have to be applied on the orange show view graphic. Perhaps just changing the order in which the transformation are applied could improve things. But what do I know, I have no idea how it's implemented.
:-) You know best. Good luck.

photo
1

Hello Martin,

my bad, I was really talking about "blend mode" and not about your "coloring mode", sorry.

Coloring mode is a different story. There are no limitations, so all three available coloring modes should correctly use hardware acceleration of your device. "Shov view" feature may have only a single effect (similar to the map rotation) > it causes map to draw more often. Anyway even with enabled profiler, I see no signification performance problem on my side on Pixel 5 device.

Thanks for the reference to the new Blend mode API. It anyway require quite new devices, but I'll look at it.

It is anyway not a problem of this coloring system because it use different technique called "ColorMatrixColorFilter" that a) should not be affected by any perfornance problems and b) it is applied directly on the map itself.

In your case, it anyway looks like there is a quite simple solution > do not use the "Shov view" feature :). I do not see any other solution now, sorry.

Jiří M. aka Menion

photo
1

Ahh, so "coloring mode" shouldn't affect performance much? BUT in my case it clearly does in combination with Show view!
In this 3min video I compare the different feature combinations. If it won't be fixed I will indeed just deactivate the Show view (although it's a handy feature I use all the time (although the orientation is often inaccurate/wrong and misguides me :-D))
P.S. Map rotation + Color mode runs smooth.

photo
2

Hello Martin,

sorry for the late response. Thanks for the video, really really interesting, There indeed should not be a performance problem and on my device(s), nothing like this happens.

"Show view" is an image that is 4x bigger than what you see, just to keep it centered and rotated correctly. Maybe this "big" semitransparent image causes problems on your device. You may give a try to the "Course bearing" and "Heading" lines. "Heading line" should display the same orientation as this "Show view" and the only difference is that here app draws a simple line programmatically. So if there won't be any problem, it will be definitely an issue in drawing "View image".

photo
1

With "Heading line" it's ok! Thanks for the info. I will use this option instead.

photo
1

I may create a separate thread for the general problem of Locus feeling unresponsive. Or is high latency only a problem on my phones? If you compare it with other map apps the difference is palpable and with HWUI you see the staggering difference.
I don't want to nag around. I just think that this is an important topic with high return of investment. If I believe the HWUI graph, then the cause might lie in the Rendering Stage "Draw" and "Misc Time / VSync Delay", so perhaps there is some forgotten function running in the draw function or UI thread.

photo
1

Hello Martin,

hmm, so it really seems to be a problem with the big "show view" semitransparent icon. Interesting is, even on very low-end Samsung A7 device, I saw no significant difference.

If you find a moment to report any observed problems with performance, it will be more than welcome of course. Not sure I'll be able to do something, but at least we may try it, thanks!

Replies have been locked on this page!