UnityTech / UIWidgets

UIWidget is a Unity Package which helps developers to create, debug and deploy efficient, cross-platform Apps.
Other
1.97k stars 256 forks source link

Ui slow on old Android device (OnePlus One) #426

Open BattlefieldNoob opened 4 years ago

BattlefieldNoob commented 4 years ago

Firstly, I thank you for this awesome library for unity (and I don't understand why isn't a official unity library/package), but I noticed that on my OnePlus One smartphone (or generally on old devices) the ui is very very slow, almost unusable (specially when scrolling a list/grid). I've tried also the UIWidgetsGallery, but I saw the same behavior (the framerate have some spikes at 15/10 fps). I tested it on unity 2019.3.9f1 and 2020.1b5. On iPhone XR it work very well. I thought, it's possible to reduce the rendertexture resolution? The render phase should become faster right?

Thank you and sorry for my English

PS: I'm using Android 10 with custom ROM, but I don't have problems with other apps or games

BattlefieldNoob commented 4 years ago

I attach screenshot of the unity profiler, using UIWidgetsGallery example

Scrolling up/down a two card list ScrollListUpDown

Pressing a button from gallery home ButtonClick

Pressing same button, but with deep profile enabled on inspection ButtonClickDeepProfile

zhuxingwei commented 4 years ago

Hi, Thanks a lot for the issue report and sorry for this late response.

(1) Yes, unlike flutter, UIWidgets relies on Unity runtime as its host. Therefore the runtime would add some extra burden to CPU, which may probably cause significant laggy on old devices.

(2) Currently UIWidgets is fully tested only on Unity 2019.1.14f1 (including performance tests). Therefore this performance issue may also be caused by some incompatibility between UIWidgets and the later versions of Unity.

(3) Yes, I think you can change the screen resolution of your project in PlayerSettings. It should remedy the performance issue if it is caused by a GPU bound.

PROGrand commented 3 years ago

I have poor repaint performance on almost all 2019-2020 Android devices with Unity 2020.2.1f1 (at least). I remove frameSpeedup/frameCooldown functionality using following:

...
private static void FrameRateSpeedUp() {
}

private static void FrameRateCooldown() {
}

private void Start() {

    Unity.UIWidgets.UI.Window.onFrameRateSpeedUp = FrameRateSpeedUp;
    Unity.UIWidgets.UI.Window.onFrameRateCoolDown = FrameRateCooldown; 
...

At least with mine scenes all glitches gone.