mattermost / mattermost-mobile

Next generation iOS and Android apps for Mattermost in React Native
https://about.mattermost.com/
Apache License 2.0
2.25k stars 1.36k forks source link

App is low on fps on new upgrade to android 11 #5046

Closed Barlerer closed 3 years ago

Barlerer commented 3 years ago

Summary

Since upgrading my S20 plus to the new android 11 update, the app appears to perform super slow. I have also attached a view, and the low fps you will see is not from the recording, but from only the mattermost app.

Environment Information

Steps to reproduce

Have an S20 with the latest update, install mattermost app and try to use anything, you will notice the sluggish behaviour

Expected behavior

Before the upgrade, the app used to work very fast and was performing well.

Observed behavior

Doesn't matter which channel or team, once I open the app every thing is very low performance Video the online preview makes it a bit hard to see the difference, try to download the file to best see the issue

Possible fixes

If you can, link to the line of code that might be responsible for the problem.

amyblais commented 3 years ago

Does this happen after re-installing the app? We suspect this may be device-specific.

Barlerer commented 3 years ago

Yes, also after re-installing.

בתאריך יום ו׳, 18 בדצמ׳ 2020, 16:24, מאת Amy Blais ‏< notifications@github.com>:

Does this happen after re-installing the app? We suspect this may be device-specific.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mattermost/mattermost-mobile/issues/5046#issuecomment-748110717, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIIFYBESU6LLI2VPTQFUWQ3SVNQZRANCNFSM4VAZKH6A .

koenrot commented 3 years ago

Just here to let you know I have the exact same issue on a similar phone.

There is no difference in having the phone run on 120fps or 60 fps. The app appears to be running on a much lower framerate. Can't really say how much fps exactly, but if I have to guess it would be lower than 25fps.

Environment Information

SteveJos commented 3 years ago

I can confirm this issue since the upgrade to Android 11 on my Samsung Galaxy S20+ The navigation in the app is sluggish and slow. The developer overlay shows a maximum of 30fps in the app. All other apps works as usual. Screenshot_20210106-110146_Mattermost

panther7 commented 3 years ago

Same problem, Samsung S10e, Android 11... Maybe bug is in OneUI 3.0 by Samsung.

dmitriy-boev commented 3 years ago

Same thing on s10, android 11.

kirkbowe commented 3 years ago

Same low frame rate issue on Samsung Note 20 Ultra. Latest Android 11 and One UI 3. Mattermost client 1.39.0 (build 3000341). Have not noticed any other apps exhibiting the same issue. No difference whether device is set to fixed 60 Hz or adaptive 120 Hz. Had a quick look at a few other React Native apps but didn't notice the same issue.

rajpootathar commented 3 years ago

same issue on my galaxy note 10 + , android 11 and one UI 3 update.

loicsapone commented 3 years ago

Same problem on my Samsung since the upgrade from Android 10 to 11 (OneUI 2 to 3)

Environment Information

Device Name: Samsung Galaxy S10 OS Version: Android 11, OneUI 3.0 Mattermost App Version: 1.39.0 Mattermost Server Version: 5.30.0

jfolz commented 3 years ago

Also here, S10e after update to Android 11 / OneUI 3.0. The actual chat portion of the app is barely usable. Settings and such are unaffected.

ahmednabil950 commented 3 years ago

I am using s20 plus and i can tell this is a confirmation that the app on latest upgrade is really super slow in navigation and any animation effect is slow (very obvious in side menu)

dmitriy-boev commented 3 years ago

Seems resolved after latest web view update.

amyblais commented 3 years ago

Would you have more details on what update fixed the issue?

rezun commented 3 years ago

Seems resolved after latest web view update.

I just installed the most recent version 88.0.4324.141 (released today) but it didn't change anything. The problem still persists.

jfolz commented 3 years ago

Update didn't make any difference for me either. Same for the beta, dev, and canary WebView apps. There is no appreciable difference between any of these.

Barlerer commented 3 years ago

Same for me, updated web views and not change

stuartm commented 3 years ago

Same issue with S10 updated to Android 11, it's unusable. Conversely mattermost in the browser on the same device is lightning fast. This is the only app with the issue so far in my testing, that includes other html based apps using webview.

AIRpwnz commented 3 years ago

Same for me, samsung s10e Very low fps in the app

vbrz commented 3 years ago

I also have this issue (Galaxy S20 Ultra)

panther7 commented 3 years ago

We know, we know, problem is Samsung/OneUI 3.0/Android 11.

Question is, whether will be Mattermost app fixed?

enahum commented 3 years ago

Hi all, I've attempted something to try and see if it helps, I was unable to really test it as the app worked without issues on my Pixel 4.

Would you please try running this version https://pr-builds.mattermost.com/mattermost-mobile/android-pr-fps/Mattermost_Beta.apk and report back?

Thanks in advance

rajpootathar commented 3 years ago

Hi all, I've attempted something to try and see if it helps, I was unable to really test it as the app worked without issues on my Pixel 4.

Would you please try running this version https://pr-builds.mattermost.com/mattermost-mobile/android-pr-fps/Mattermost_Beta.apk and report back?

Thanks in advance

Hi @enahum , I tried the build you mentioned.. it is still clunky and fps are really bad for me

device : Note 10 + (One Ui 3+) Android Version : 11

enahum commented 3 years ago

@rajpootathar interesting as I'm setting the app to use the max amount of fps available on the device

 protected void setFrameRate() {
        ArrayList<HashMap<String, Object>> supported = getSupportedModes();
        boolean seen = false;
        HashMap<String, Object> best = null;
        for (HashMap<String, Object> stringObjectHashMap : supported) {
            if (!seen || (Float)stringObjectHashMap.getOrDefault("refreshRate", 0f) > (Float)best.getOrDefault("refreshRate", 0f)) {
                seen = true;
                best = stringObjectHashMap;
            }
        }

        if (best != null && best.get("id") != null) {
            final Window window = this.getWindow();
            final WindowManager.LayoutParams params = window.getAttributes();
            params.preferredDisplayModeId =(int)best.get("id");
            window.setAttributes(params);
        }
    }

wondering what else could cause this and also why it only seems to be affecting Samsung with One UI 3+

Barlerer commented 3 years ago

Hi all, I've attempted something to try and see if it helps, I was unable to really test it as the app worked without issues on my Pixel 4.

Would you please try running this version https://pr-builds.mattermost.com/mattermost-mobile/android-pr-fps/Mattermost_Beta.apk and report back?

Thanks in advance

Also doesn't work for me

enahum commented 3 years ago

One long shot, what happens if you enable Developer options in your phone and change the settings for:

and set them all to .5x

Barlerer commented 3 years ago

One long shot, what happens if you enable Developer options in your phone and change the settings for:

  • Window animation scale
  • Transition animation scale
  • Animator duration scale

and set them all to .5x

Also doesn't work.

svelle commented 3 years ago

Hey @SteveJos could you give me some more info on what kind of tool you used to get these detailed metrics from your screenshot. I'm seeing similar behavior on my Pixel 5 and would like to further investigate.

VincentSC commented 3 years ago

One UI 3.1 is out for S20 and S21. Has this maybe solved it? https://news.samsung.com/us/samsung-one-ui-3-1-update-powerful-features-galaxy-s21-galaxy-s20-galaxy-note20-galaxy-z-series/

VincentSC commented 3 years ago

For measuring performance see https://developer.android.com/training/testing/performance I'm happy to run a test, but have no time to define it.

svelle commented 3 years ago

Okay I think I somehow understood the metrics capture info from adb, thanks @VincentSC

If anyone who's running into the issue could do the following I'd greatly appreciate it:

Thanks y'all hopefully we can get to the bottom of this :)

tpgxyz commented 3 years ago

Yes i can confirm that after update to Android 11 on my SM-G973F, the mattermost 1.39.0 application started to act very slow on:

Here is a screenshot from an empty channel, I just swiped down to refresh it and after that you can notice all the spikes on GPUWatch graphs. Screenshot_20210219-103546_Mattermost

tpgxyz commented 3 years ago

@svelle Hope this will help a bit: adb shell dumpsys gfxinfo com.mattermost.rn framestats > gfxinfo.log

Applications Graphics Acceleration Info:
Uptime: 522035653 Realtime: 1207700358

** Graphics info for pid 23853 [com.mattermost.rn] **

Stats since: 522014152226810ns
Total frames rendered: 113
Janky frames: 76 (67.26%)
50th percentile: 44ms
90th percentile: 150ms
95th percentile: 150ms
99th percentile: 200ms
Number Missed Vsync: 42
Number High input latency: 50
Number Slow UI thread: 39
Number Slow bitmap uploads: 3
Number Slow issue draw commands: 60
Number Frame deadline missed: 61
HISTOGRAM: 5ms=0 6ms=0 7ms=0 8ms=0 9ms=3 10ms=2 11ms=7 12ms=7 13ms=7 14ms=4 15ms=2 16ms=6 17ms=2 18ms=3 19ms=1 20ms=0 21ms=0 22ms=0 23ms=1 24ms=0 25ms=0 26ms=0 27ms=0 28ms=1 29ms=0 30ms=2 31ms=1 32ms=1 34ms=1 36ms=1 38ms=0 40ms=2 42ms=1 44ms=4 46ms=1 48ms=6 53ms=4 57ms=8 61ms=3 65ms=2 69ms=1 73ms=2 77ms=2 81ms=2 85ms=0 89ms=0 93ms=1 97ms=0 101ms=0 105ms=0 109ms=0 113ms=0 117ms=1 121ms=0 125ms=1 129ms=0 133ms=0 150ms=18 200ms=2 250ms=0 300ms=0 350ms=0 400ms=0 450ms=0 500ms=0 550ms=0 600ms=0 650ms=0 700ms=0 750ms=0 800ms=0 850ms=0 900ms=0 950ms=0 1000ms=0 1050ms=0 1100ms=0 1150ms=0 1200ms=0 1250ms=0 1300ms=0 1350ms=0 1400ms=0 1450ms=0 1500ms=0 1550ms=0 1600ms=0 1650ms=0 1700ms=0 1750ms=0 1800ms=0 1850ms=0 1900ms=0 1950ms=0 2000ms=0 2050ms=0 2100ms=0 2150ms=0 2200ms=0 2250ms=0 2300ms=0 2350ms=0 2400ms=0 2450ms=0 2500ms=0 2550ms=0 2600ms=0 2650ms=0 2700ms=0 2750ms=0 2800ms=0 2850ms=0 2900ms=0 2950ms=0 3000ms=0 3050ms=0 3100ms=0 3150ms=0 3200ms=0 3250ms=0 3300ms=0 3350ms=0 3400ms=0 3450ms=0 3500ms=0 3550ms=0 3600ms=0 3650ms=0 3700ms=0 3750ms=0 3800ms=0 3850ms=0 3900ms=0 3950ms=0 4000ms=0 4050ms=0 4100ms=0 4150ms=0 4200ms=0 4250ms=0 4300ms=0 4350ms=0 4400ms=0 4450ms=0 4500ms=0 4550ms=0 4600ms=0 4650ms=0 4700ms=0 4750ms=0 4800ms=0 4850ms=0 4900ms=0 4950ms=0
50th gpu percentile: 6ms
90th gpu percentile: 9ms
95th gpu percentile: 9ms
99th gpu percentile: 13ms
GPU HISTOGRAM: 1ms=0 2ms=1 3ms=9 4ms=18 5ms=11 6ms=30 7ms=20 8ms=9 9ms=8 10ms=1 11ms=0 12ms=1 13ms=1 14ms=1 15ms=0 16ms=0 17ms=0 18ms=0 19ms=0 20ms=0 21ms=0 22ms=0 23ms=0 24ms=0 25ms=0 4950ms=0
Font Cache (CPU):
  Size: 369.93 kB 
  Glyph Count: 46 
CPU Caches:
GPU Caches:
  Other:
    Other: 79.12 KB (1 entry)
  Shadow Gaussian Falloff:
    Texture: 128.00 bytes (1 entry)
  Image:
    Texture: 468.90 KB (7 entries)
  Scratch:
    Texture: 12.00 MB (2 entries)
    Buffer Object: 78.00 KB (2 entries)
Other Caches:
                         Current / Maximum
  Layers Total           0.00 KB (numLayers = 0)
Total GPU memory usage (Max: 200 MB):
  13224088 bytes, 12.61 MB (149.02 KB is purgeable)

Pipeline=Skia (OpenGL)
Profile data in ms:

    com.mattermost.rn/com.mattermost.rn.MainActivity/android.view.ViewRootImpl@86da033 (visibility=0)

---PROFILEDATA---
Flags,IntendedVsync,Vsync,OldestInputEvent,NewestInputEvent,HandleInputStart,AnimationStart,PerformTraversalsStart,DrawStart,SyncQueued,SyncStart,IssueDrawCommandsStart,SwapBuffers,FrameCompleted,DequeueBufferDuration,QueueBufferDuration,GpuCompleted,
1,522014188765156,522014188765156,9223372036854775807,0,522014189743041,522014189744117,522014189744464,522014204460540,522014205075271,522014205252348,522014205438233,522014234820348,522014236806733,801654,320308,522014237617310,
1,522014340707767,522014340707767,9223372036854775807,0,522014341827733,522014341828771,522014341875463,522014349328887,522014349493002,522014349772617,522014349874387,522014351504425,522014352123733,91962,310230,522014353198117,
---PROFILEDATA---

View hierarchy:

  com.mattermost.rn/com.mattermost.rn.MainActivity/android.view.ViewRootImpl@86da033
  1068 views, 1758,50 kB of render nodes

Total ViewRootImpl   : 1
Total attached Views : 1068
Total RenderNode     : 1758,50 kB (used) / 5566,25 kB (capacity)

  ProcessConfig(#0)={1.1 260mcc3mnc [pl_PL] ldltr sw360dp w360dp h707dp 640dpi nrml long port finger -keyb/v/h -nav/h winConfig={ mBounds=Rect(0, 0 - 1440, 3040) mAppBounds=Rect(0, 149 - 1440, 2980) mWindowingMode=fullscreen mDisplayWindowingMode=fullscreen mActivityType=undefined mAlwaysOnTop=undefined mRotation=ROTATION_0} s.104918 desktop/d ?dc ?dcui ?dcaf bts=0 ff=0 bf=0 themeSeq=0}
  Application ResourcesConfig={1.1 260mcc3mnc [pl_PL] ldltr sw360dp w360dp h707dp 640dpi nrml long port finger -keyb/v/h -nav/h winConfig={ mBounds=Rect(0, 0 - 1440, 3040) mAppBounds=Rect(0, 149 - 1440, 2980) mWindowingMode=fullscreen mDisplayWindowingMode=fullscreen mActivityType=undefined mAlwaysOnTop=undefined mRotation=ROTATION_0} s.104918 desktop/d ?dc ?dcui ?dcaf bts=0 ff=0 bf=0 themeSeq=0}
  TopActivityClient=ActivityRecord{7eeeff0 token=android.os.BinderProxy@42fb454 {com.mattermost.rn/com.mattermost.rn.MainActivity}}
  TopActivityClient OverrideConfig: {1.1 260mcc3mnc [pl_PL] ldltr sw360dp w360dp h707dp 640dpi nrml long port finger -keyb/v/h -nav/h winConfig={ mBounds=Rect(0, 0 - 1440, 3040) mAppBounds=Rect(0, 149 - 1440, 2980) mWindowingMode=fullscreen mDisplayWindowingMode=fullscreen mActivityType=standard mAlwaysOnTop=undefined mRotation=ROTATION_0} s.1 desktop/d dc/d ?dcui ?dcaf bts=0 ff=0 bf=0 themeSeq=0}
  TopActivity=com.mattermost.rn.MainActivity@9fdc1c0
  TopActivity ResourcesConfig={1.1 260mcc3mnc [pl_PL] ldltr sw360dp w360dp h707dp 640dpi nrml long port finger -keyb/v/h -nav/h winConfig={ mBounds=Rect(0, 0 - 1440, 3040) mAppBounds=Rect(0, 149 - 1440, 2980) mWindowingMode=fullscreen mDisplayWindowingMode=fullscreen mActivityType=standard mAlwaysOnTop=undefined mRotation=ROTATION_0} s.1 desktop/d dc/d ?dcui ?dcaf bts=0 ff=0 bf=0 themeSeq=0}
jfolz commented 3 years ago

I noticed that framerate is low when text messages are on screen, but normal if there is nothing but thumbnails.

https://user-images.githubusercontent.com/3245870/108609302-58c92800-73cd-11eb-8ab0-b7cd2ff009ae.mp4

rezun commented 3 years ago

Can confirm this (Issue #5131)

Barlerer commented 3 years ago

One UI 3.1 is out for S20 and S21. Has this maybe solved it? https://news.samsung.com/us/samsung-one-ui-3-1-update-powerful-features-galaxy-s21-galaxy-s20-galaxy-note20-galaxy-z-series/

Just updated, still same issue.

vbrz commented 3 years ago

I updated to OneUI 3.1 and I can confirm that the problem is still present.

enahum commented 3 years ago

Here you'll find an apk that forces the app to run at 60 fps, this is an attempt to see if the app runs better on your devices but no promises hehehe.

That said, it would be awesome if you can try it and report back, even better if you upload a comparison video between the current app in the Play Store and the apk shared in the PR.

Thanks

Barlerer commented 3 years ago

Here you'll find an apk that forces the app to run at 60 fps, this is an attempt to see if the app runs better on your devices but no promises hehehe.

That said, it would be awesome if you can try it and report back, even better if you upload a comparison video between the current app in the Play Store and the apk shared in the PR.

Thanks

I have tried, and there is no difference. Works the same as the regular app.

enahum commented 3 years ago

Can you share a video?

Barlerer commented 3 years ago

Can you share a video?

I'm afraid I cannot, I'm in a confidential workspace that requires privacy for the members. Don't have the tools to blur the video.

enahum commented 3 years ago

@Barlerer you could always create an account and connect to our community server :)

Barlerer commented 3 years ago

New version https://user-images.githubusercontent.com/34626564/109554099-7b99c180-7adc-11eb-9c59-bf494e4998e2.mp4

Google Play version: https://user-images.githubusercontent.com/34626564/109554398-d7fce100-7adc-11eb-8876-e38c6e531299.mp4

enahum commented 3 years ago

Anyone else using Right to Left? Or does it happen with left to right?

also this seems to be a Time to Render issue that won’t be solved until v2 (hopefully) aimed for Q3/Q4 this year

jnugh commented 3 years ago

Hi all, same problem for me. in my case LTR environment. Tested the Beta too, no difference. Not sure if this helps but I created a systrace (as described in https://reactnative.dev/docs/profiling) trace.html.zip

Ch1llb0 commented 3 years ago

Same issue here and persisting after upgrade to Android 11 (LOS 18.1 on Xiaomi Mi A2 Lite Daisy) and new install of the app. Laggy as hell.

panther7 commented 3 years ago

Still no fix, after 4 month? :'(

vbrz commented 3 years ago

Still no fix, after 4 month? :'(

Yes, same here, to this day the problem is still not fixed for my device (even with mattermost beta)

zetaab commented 3 years ago

so none in mattermost mobile developers has device which has this problem?

enahum commented 3 years ago

I do and I can reproduce, so far been unable to pinpoint the cause, there are many many moving parts.

Sadly enough I can't spend a lot of time on this as I'm currently I'll and will undergo surgery this Monday, March 29

I can asure you we are indeed looking into this trying to get it resolved

enahum commented 3 years ago

Can we give this apk a try and see if it got a little bit better?

Thanks