Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Understanding performance on android

Discussion in 'Android' started by lofwyre, Mar 4, 2015.

  1. lofwyre

    lofwyre

    Joined:
    Apr 19, 2007
    Posts:
    166
    Hi

    I'm using a;
    Samsung Galaxy Tab 3 Tablet
    - 1.2 Dual Core Processor
    - 1 Gig RAM
    - 1024 x 600 Screen Rez

    Unity 5.0.0f4

    I've created a scene with a cube sitting on a plane, both using a default texture. No skybox. Quality settings are at "Fast" with no shadows.

    V Sync is set to "Don't Sync"

    I'm running with the device connected to the profiler over wifi

    performance_1.jpg

    What I see on the device is a fluctuation between 40 fps and around 62 fps.

    Drawcalls are at "4"

    The only CPU usage is the Graphics.PresentAndSync -> Device.Present which fluctuates at 16ms to 30ms and would seem to account for the final fps reported.

    Removing the fps counter does not change the results in the profiler, running without the profiler does not change the fps results.

    My questions are:

    1. Is this expected behavior for an almost empty project?
    2. Why the erratic fluctuation, I expect some overhead, but should it be going up and down by 16ms?

    Thanks for any input.

    Regards
    Matt
     
  2. lofwyre

    lofwyre

    Joined:
    Apr 19, 2007
    Posts:
    166
    On watching the FPS longer I see after about 30 seconds it settles down and runs at 42 to 43 fps. The CPU usage for device.present still seems to be the only item in the profiler accounting for the drop in performance.

    When I run a release build with no profiler, I still see 42 to 43 fps.

    I've disabled the mesh and box collider in the scene. Removed the light, etc. With no noticeable change.

    Regards
    Matt
     
  3. lofwyre

    lofwyre

    Joined:
    Apr 19, 2007
    Posts:
    166
    Running on windows phone 8

    I get 59 to 60 fps and Graphics.PresentAndSync -> Device.Present 0ms taking 0% of the cpu.

    I'm confused why I don't see this result on Android.
     
  4. lofwyre

    lofwyre

    Joined:
    Apr 19, 2007
    Posts:
    166
    Ok, interestingly the same build deployed to an older device does not exhibit the same issue.

    Samsung Galaxy S2 phone
    - 1.2 Dual Core Processor
    - 1 Gig RAM
    - 800 x 600 Screen Rez

    Idles around 59 to 60 fps and about 12ms cpu, Graphics.PresentAndSync -> Device.Present 0.87ms

    So at this stage it seems perhaps the GPU on the Samsung Galaxy Tab (Vivante GC1000) is presenting an issue not present in the other devices.
     
  5. R-V

    R-V

    Joined:
    Mar 15, 2015
    Posts:
    1
    I've observed the same behaviour on my tablet:
    - Rockchip RK3188 (Quad-core ARM Cortex-A9, Mali-400 MP4)
    - Android 4.2.2
    - 2048x1536
    - 44 fps (only camera)

    upload_2015-3-15_15-8-11.png
     
    Deanit likes this.
  6. lavz24

    lavz24

    Joined:
    Mar 14, 2013
    Posts:
    45
    You found any answer? I have the same problem
     
  7. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    It's the Mali-400 MP4 chip. They aren't the greatest. You want a MP 450 or newer quad core GPU. And you want Android 4.4.4 or newer. And you want 1024 RAM.
     
  8. lavz24

    lavz24

    Joined:
    Mar 14, 2013
    Posts:
    45
    I have the problem in Motorola G 1st and 2gn. Also in other devices
     
  9. Deanit

    Deanit

    Joined:
    Nov 29, 2013
    Posts:
    6
    The very same on Motorola Xoom 2 ME, and PMP5570c tablets. However all runs smoothly on LG g2 mini. My opinion it is graphic adapter drivers compatibility issue.

    Update: for me it is likely Lightmap. I disabled lightmap and set lights to not cast shadows -> fps doubled. But it was baked lightmap, what's the point?

    Update: It was not lightmap issue, but if you have lightmap, you should turn off shadow on all your lights, otherwise game will slow down on mobile
     
    Last edited: Mar 27, 2015
  10. lavz24

    lavz24

    Joined:
    Mar 14, 2013
    Posts:
    45
    I found the problem, on my case the problem was l had too much draw calls with the new ui. I think the profiler need improve tho show better information.
     
  11. dixitalgorismi

    dixitalgorismi

    Joined:
    Aug 6, 2013
    Posts:
    30
    I have a similiar problem on Android only. iOS is fine. I'm adaptively disabling a couple of image effect based on the current FPS by first disabling the image effect component and then destroying the component (so they won't blit from src to dest) every update anymore.

    With the effects enabled, the Graphics.PresentAndSync node shows a child Device.Present with taking an average of 43.9% of the CPU time on a Moto G2. As a child this node has Present.BlitToCurrentFB. I don't know if this is rendering to screen or the copying of the src rendertexture to the destination rendertexture in the OnRenderImage callbacks of the image effects. I somewhat expected this to happen on GPU and not on CPU though.

    Anyway, if I disable the effects at runtime, the performance is worse than when running the same build without the image effects in the first place. There are up to 15 frames/s missing. There are regular spikes of Device.Present and Present.BlitToCurrentFB. This drives me nuts. I don't understand why there is a performance overhead when the image effects scripts and OnRenderImage callbacks are not present anymore. This seems to happen only on Android with Unity 5.0.1f.

    Any ideas?

    P.S.: You should stop scaling quality settings by just disabling the image effect scripts at runtime like most "solutions" in the forum suggest. The OnRenderImage callback that copies from the source rendertexture to the destination rendertexture is still called when the script is disabled!
     
    Last edited: Apr 18, 2015