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

FPS drop in the second app launch (dropping about 10-15fps)

Discussion in 'Editor & General Support' started by Feelnside, Aug 20, 2018.

  1. Feelnside

    Feelnside

    Joined:
    Sep 30, 2016
    Posts:
    83
    Just figured out the fps drop in the second app launch. I'm using the old tablet (prestigio multipad 4 ultra quad 8.0 3G) and there are the problem with the fps in the second app launch.

    At the first time everything is okay, I'm getting about 30-38fps which is pretty good for such old device but after closing the app and reopening it I'm loosing about 10-15fps. There are no difference between the scenes. Everything is the same but in the second launch fps downs to 20-25 (instead of 30-38).

    If I clear the app cache and the data - fps goes back to 30-38, but the relaunch decreasing the fps back to 20-25. Per profile, looks like there some issue with the GPU. Gfx.WaitForPresent appears in the second launch which means that CPU is waiting for GPU (vsync is off, targetframerate = 60).

    Unfortunately I'm not able to test it on some other old device (nexus 5x, asus zen phone 3 runs at 60fps so there are no difference).

    Tried to test it in the empty project and there are 5-6 fps drop (so looks like it's not a project-specific problem).

    Maybe someone was faced such problem before?
     

    Attached Files:

  2. Feelnside

    Feelnside

    Joined:
    Sep 30, 2016
    Posts:
    83
    The same issue is reproducible on Lenovo A830. Looks like I have to log an issue.
     
  3. PVisser

    PVisser

    Joined:
    Apr 24, 2014
    Posts:
    61
    Seems like some sort of 'active' vs 'idle' mode to me where the phone/device goes into 'active' CPU/GPU clocks when you first start the app, but quitting out puts it in 'idle' mode which uses lower clocks and causes the lower fps and when you relaunch the app it doesn't detect that it should be in 'active' mode again for some reason.
     
  4. Feelnside

    Feelnside

    Joined:
    Sep 30, 2016
    Posts:
    83
    I tried to restart the tablet and there are no success. It still has a fps drop. So the issue is related to some unity processes. Only cache/data remove or reinstall has no fps drop at the first launch. I'm worried that this issue can affect the all devices. For example it's not visible on Nexus 5x, but I suppose it would has some hidden performance impacts which lead to throttling.
     
  5. Feelnside

    Feelnside

    Joined:
    Sep 30, 2016
    Posts:
    83
    Could some one verify that issue on any OpenGL ES 2.0 device? Just build any empty project with the default skybox (you can add some plane and severals spheres) and check FPS at the first and at the second launches using that script:

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class FPSDisplay : MonoBehaviour
    5. {
    6.     float deltaTime = 0.0f;
    7.  
    8. void Awake()
    9. {
    10. Application.targetFrameRate = 60;
    11. }
    12.  
    13.     void Update()
    14.     {
    15.         deltaTime += (Time.unscaledDeltaTime - deltaTime) * 0.1f;
    16.     }
    17.  
    18.     void OnGUI()
    19.     {
    20.         int w = Screen.width, h = Screen.height;
    21.  
    22.         GUIStyle style = new GUIStyle();
    23.  
    24.         Rect rect = new Rect(0, 0, w, h * 2 / 50);
    25.         style.alignment = TextAnchor.UpperLeft;
    26.         style.fontSize = h * 2 / 50;
    27.         style.normal.textColor = new Color(1.0f, 1.0f, 0.5f, 1.0f);
    28.         float msec = deltaTime * 1000.0f;
    29.         float fps = 1.0f / deltaTime;
    30.         string text = string.Format("{0:0.0} ms ({1:0.} fps)", msec, fps);
    31.         GUI.Label(rect, text, style);
    32.     }
    33. }
    34.