Android Question Performance issues

Jack Cole

Well-Known Member
Licensed User
Longtime User
As of August, 2017, Google started factoring in "app quality" into their ranking algorithm. For my popular apps, this has been a problem based on their speed metrics. Truthfully, I think the app runs fast, and I think it is probably partly related to the way they are measuring. Regardless, this is something that is hurting my app business. The stats below are for Mind Games.

Here is where I am getting hurt by the measures.





Are other people experiencing similar problems? Look at Android vitals in the dashboard.

I am having trouble even on less complex apps that seem to run quite fast too me (for example: Minesweeper).



I'm wondering if there are any ideas on fixing this or at least making the app perform in a way that is measured more correctly by Google's metrics.
 

sorex

Expert
Licensed User
Longtime User
I don't have any info on most of my apps. on one that lists some percentages it's

Slow UI rendering
Last 30 days:88.31% Previous 30 days:86.70% Bad behavior threshold:1.56%

bizarre because the app runs (visible) smooth for almost 2 years even on the old 2.2/2.3.6 hardware.

maybe it's linked to the fact that the firebase stuff is in it and causes delay for the logging?

Edit: even more bizarre last 30 days was 100% free of ANR & Crashes. Isn't ANR slow responses of apps?
 
Last edited:
Upvote 0

sorex

Expert
Licensed User
Longtime User
just asked some google emplyee about all this and that it doesn't make sense that I have such high percentage
for an app that doesn't even need 60fps while being a thinking game that only does screen updates when a user interacts.

here are his replies...

 
Upvote 0

sorex

Expert
Licensed User
Longtime User
well in your brain game you don't need constant 60fps either so where could that lag be comming from?

seems more like a feature that still needs some serious fine tuning.

you can always send the google guys a mail for more info about the visibility.
 
Upvote 0

Jack Cole

Well-Known Member
Licensed User
Longtime User
I just did a little test--loading just the main menu layout for Mind Games. I get significant jank just on that. Of course, it looks just fine, but problems are being registered.


Erel, does the designer layout code run after the views are added to the screen? I'm wondering if there is some mixing of computation and screen drawing.

Anyway, I should be able to experiment some with this minimal example to see if I can figure out what is happening.
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
In my case I'm not using the designer files but pure code.

also notice that the trigger of 16ms is extremely low. I guess a loadlayout with some labels is already going beyond that.

other than that how on earth can you find what else is causing that jank?
I'm just updating a label, playing a tick sound and check completion when a user interacts.

this are the stats of mine, they stay the same once the menu is displayed and when playing.

Total frames rendered: 391
Janky frames: 7 (1.79%)
90th percentile: 11ms
95th percentile: 13ms
99th percentile: 16ms
Number Missed Vsync: 3
Number High input latency: 0
Number Slow UI thread: 5
Number Slow bitmap uploads: 0
Number Slow issue draw commands: 3
 
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Erel, does the designer layout code run after the views are added to the screen?
The designer script is run after the views are loaded. The screen is only refreshed after Activity_Create completes (unless you call Sleep or Wait For).

If you are loading a large layout file then you can get better responsiveness by splitting it into several files and then load them:
1. when needed
2. with calls to Sleep(0) in between
 
Upvote 0

Jack Cole

Well-Known Member
Licensed User
Longtime User
I can confirm that the app vitals play a role in ranking per contact with Google. They won't tell me if my apps are affected, but just note that you want to try to resolve any issues shown in app vitals.
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
the problem remains... which part is the problem part? just a percentage doesn't tell much.

if it showed the subs that causes a possible slowdown on some devices you know atleast where to look at.

and are the ad views counted in this aswell? not much you can do about that.
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
just found this...


the only game I get stats of is using:

<uses-sdk android:minSdkVersion="15" android:targetSdkVersion="15"/>

would raising the target really solve something?

as written before it's was tested on real 2.x, 4.x and 6.x devices and it works fine without any lag.


Edit: a big difference with yours, Jack, is that nothing is in red.
 
Last edited:
Upvote 0

sorex

Expert
Licensed User
Longtime User
here's min. I guess the green line is the 16ms mark?

the peak is the level loading which only occurs once unless you change grid size or difficulty.
the stuff after it is random presses which just updates a label.

 
Upvote 0

sorex

Expert
Licensed User
Longtime User
when I enable the sound (tick sound) it sometimes goes above the green line which can explain the high rate if it happends on almost every click.

is the mediaplayer holding the mean tread for some miliseconds?

left tick sound on, right tich sound off

 
Last edited:
Upvote 0

sorex

Expert
Licensed User
Longtime User
I seem to have found the culprit in my case.

a color reset for all labels for the error displaying is happening even when this option is off.
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…