Search Unity

Unity 2020 2.1f worse performance than 1.17f1 significantly

Discussion in 'Editor & General Support' started by Adam_Benko, Jan 11, 2021.

  1. Adam_Benko

    Adam_Benko

    Joined:
    Jun 16, 2018
    Posts:
    105
    I updated my unity from 2020 1.17 to 2020 2.1 and my performance is much worse. When comparing the same project and the same sample scene, there is a huge difference. Is anybody running the latest stable unity release, 2.1 ? Do you have worse performance ?
    In my own scene, the difference is huge too, 40 - 50% of fps. The profiler shows difference too but not that great. Roughly 20 - 30%.

    This is a sample scene comparison:
     

    Attached Files:

  2. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,452
    The stats view previously only used the time spend in the PlayerLoop to calculate he FPS, which then ended up being different to what in game fps counters would show and possibly led to the impression that a build could be running faster than the editor. Now the FPS in the Stats view takes the entire EditorLoop into account. If you are using URP, I believe this is likely the same issue as discussed in his thread.
     
    Joe-Censored likes this.
  3. Adam_Benko

    Adam_Benko

    Joined:
    Jun 16, 2018
    Posts:
    105
    This is a comparison of the exactly same scene but one is on 2.1f1 and the other one is 1.17f1
    Look at the difference in speed for the scripts (2 times slower)
    And for some reason, the triangles and vertices count is 2 - 3x higher.

    The other problem that I see with the latest build is that for some reason, every material that has HDR value set to greater than 0, has this value multiplied by 2 - 2.5 times, including all the VFX effects. Tried to upgrade the project 2 times and the bloom values went up always by 2 - 2.5 times. (every HDR material / VFX
     

    Attached Files:

  4. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,452
    To be honest, that high level summary doesn't really tell me anything. Try reading through my post in the other thread, use the Hierarchy and Timeline views of the CPU Usage Profiler Module to understand what these categories are comprised of, use the Profile Analyzer to compare the profiler data from each version so see if you can come to a similar conclusion as I did in that thread.

    Are you using URP, HDRP or a custom RP? Those couldn't properly report their stats to the Stats view and Rendering Profiler Module pre 2020.2 (as the ProfilerCounter API was missing) so some difference there could just be down to that being fixed.

    No idea about the HDR value or how that is connected to the performance changes. Might be worth raising this in a subforum according to the render pipeline you are using?
     
  5. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,452
    Also, your CPU Usage chart has VSync and Others disabled (black boxes next to the label, clicked again will reenable their visualization) which would include Editor Loop time in Playmode captures and therefore show the proper frame time in the editor that is now used for the FPS calculation.
     
  6. Adam_Benko

    Adam_Benko

    Joined:
    Jun 16, 2018
    Posts:
    105
    I just made another test. This time on my laptop. 1.17 has 75 FPS in editor and 2.2f1 has 40 - 50 fps. And YES, the statistics in gameview show true FPS. The difference in smoothness is night and day. The 1.17 build is simply put supper smooth running at 60 fps on my notebook always (editor shows 75) and the 2.2 runs 40 - 50 fps and is really choppy.
    This is going to directly affect my workflow since I cant run scenes smoothly with more units. The performance of gameview is significantly worse in 2.2f1 and therefore I cant update to this version, which is a real shame since 2.2 contains a bugfix that is causing severe editor crashing on 1.17 (half a year ago submitted by me :( ).
    If I turn off the v-sync, the difference is even greater.
     

    Attached Files:

  7. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,452
    How? That's basically impossible on 2020.2. the FPS and main thread time there excludes EditorLoop. Please compare he performance between these versions with anything BUT the stats view. Read though this thread for details and how I compared the versions with Profile Analyzer.

    If you are using URP, the issue might be the same as in the other thread. Of not nd if you can confirm the performance decrease with something else than the stats view, then please file a bug report.
     
  8. Adam_Benko

    Adam_Benko

    Joined:
    Jun 16, 2018
    Posts:
    105
    I am now displaying FPS with this script:

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.UI;
    5. using TMPro;
    6.  
    7.  
    8. public class ShowFps : MonoBehaviour
    9. {
    10.     public TextMeshProUGUI fpsText;
    11.     public float deltaTime;
    12.  
    13.     void Update()
    14.     {
    15.         deltaTime += (Time.deltaTime - deltaTime) * 0.1f;
    16.         float fps = 1.0f / deltaTime;
    17.         fpsText.text = Mathf.Ceil(fps).ToString();
    18.     }
    19. }
     

    Attached Files:

  9. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,452
    Which render pipeline are you using?
     
  10. Adam_Benko

    Adam_Benko

    Joined:
    Jun 16, 2018
    Posts:
    105
    URP
     
  11. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,452
    Oh God, my apologies, I just realized I had copied the wrong link in my previous posts. The other thread I meant to link to is this one.
    Thank you for confirming the use of URP as I believe the issue described in the other thread and under this bug is URP specific and appears to be a change that put more burden on the CPU for better GPU performance. It's still getting processed by the URP team.

    Once again, sorry for the confusion of the wrong link. I must've mixed up my tabs and then just blindly recopied the link the second time I posted it.
     
    Lord_Eniac likes this.
  12. Lord_Eniac

    Lord_Eniac

    Joined:
    Jan 28, 2020
    Posts:
    50
    Or, perhaps you were tired. It happens. No worries.
     
    MartinTilo likes this.