Search Unity

Less than 1 fps android, can't use profiler either

Discussion in 'Android' started by djweaver, Oct 10, 2020.

  1. djweaver

    djweaver

    Joined:
    Jul 4, 2020
    Posts:
    105
    Using android remote, things work fine (of course, on the actual phone fps is not nearly as good as editor on pc)

    However, I recently did an internal test from google play console and the app is getting less than 1fps, totally unplayable, yet it is seemingly running without any other issues. (ie everything is unbearably slow and choppy but sounds/movement/logic etc seems to work)

    I cannot seem to get the profiler running either... I follow the instructions of doing a "Build and Run" with my phone on wifi network, Development build checked, and Autoconnect Profiler checked, but at the end of the build, it just doesn't run, though logcat opens and the profiler window opens. Prior to doing the Build and Run, I can run the game on Android Remote through the editor... after I do this build and run, I can't. I have to restart unity.

    So A) What could possibly be slowing my app down this much on android vs the editor? It averages around 60fps when profiled on my 3 year old laptop, and no crazy GC going on, and the profiler is generally always the biggest consumer of CPU. I have shadows disabled, and I'm not generating any variables in any update loops. In fact, I hardly use update loops at all, and when I do, they are almost always FixedUpdate for physics interactions. I do use HDR, as well as a bloom for post processing, but thats really it, aside from a couple of shaders that do some UV scrolling. What are some obvious no-nos for Android performance optimization?

    And B) How do I get the profiler working for Android? I can't test any real changes until I can see whats going on there.

    Using URP on a Blackberry KeyOne with Android 8.1. I have the appropriate API for that version (I think 27) in my SDK folder. The phone has close to the same amount of RAM as my lenovo.


    EDIT: When you are using Unity Remote, does it automagically connect to profiler? I just noticed I got different (better) results after I ran profiler without the phone connected, so I'm wondering if I've been using the profiler on the phone this whole time, not knowing Unity Remote already connected to it. IF that is the case, I'm showing steady 60fps on profiler when running on Unity Remote, yet getting <1 fps on the actual apk being ran from phone and I have no way of knowing why because the profiler doesn't reflect that
     
    Last edited: Oct 10, 2020
  2. djweaver

    djweaver

    Joined:
    Jul 4, 2020
    Posts:
    105
    Yeah something is totally screwy here. I disabled post-processing entirely with the same results... editor plays great, but when I download apk through google play I get like 1fps. I have no idea what profiler is actually connected to, but with or without phone connected via Unity Remote, I'm not seeing anything big.

    GC is rarely called, and when it is, the alloc is like 40B. There are spikes dipping into 30fps, but they are the result of editorloop with the ms being generally lower than 40ms. If you ignore the editorloop, overall time ms is rarely ever above 5ms for any given frame. 2 calls total per frame, and

    I'm using object pooling for projectiles and enemies as well as damage popup text (world space). Post disabled, shadows disabled.

    GPU is an Adreno 506, 4 gigs ram on phone