Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  3. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Degraded performance in Unity 2021.2.0b6 standalone

Discussion in '2021.2 Beta' started by oobartez, Aug 12, 2021.

  1. oobartez

    oobartez

    Joined:
    Oct 12, 2016
    Posts:
    167
    While migrating our project (a fairly complex game) from Unity 2021.1.11f1 to 2021.2.0b6 we noticed that our average FPS went down significantly.

    On our "heavy benchmark scenario" the average frame duration went up from 26.1ms to 31.6ms (FPS dropped from 38.3 to 31.7). Here's a breakdown by percentile for a 30 second benchmark:
    Percentile 95.0: 34.1 ms -> 34.3 ms
    Percentile 98.0: 34.3 ms -> 49.9 ms (!)
    Percentile 99.5: 34.4 ms -> 50.1 ms
    Percentile 99.9: 50.3 ms -> 50.5 ms

    So the 95th percentile stayed the same but there are constant spikes, about once every 1-2 seconds.

    We would normally suspect GC but GC spikes are usually rarer and longer and the project is fairly well optimized with regards to allocations.

    We are still investigating it but so far we could not figure out what is causing those spikes. The profiler didn't help much, because of how the profiler itself affects performance. We'll update this thread if we find out anything.

    Has anyone else seen degraded performance in 2021.2? Do you have any clues where we should look?
     
    Last edited: Aug 12, 2021
  2. oobartez

    oobartez

    Joined:
    Oct 12, 2016
    Posts:
    167
    The data is for a standalone macOS build. The project uses URP.
     
    Last edited: Aug 12, 2021
  3. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,536
    Probably best to send a bug report with the performance benchmarks you did
     
  4. oobartez

    oobartez

    Joined:
    Oct 12, 2016
    Posts:
    167
    For the record, the changes between the two benchmarks were:
    Otherwise it is the same project.
     
    Last edited: Aug 12, 2021
  5. oobartez

    oobartez

    Joined:
    Oct 12, 2016
    Posts:
    167
    That's what we'll do when we get more data. I was hoping that someone else has already had that problem and could suggest where we should look.
     
  6. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,536
    Is automatic garabage collection enabled in player settings?

    If so try turning it of and benchmark again
     
  7. oobartez

    oobartez

    Joined:
    Oct 12, 2016
    Posts:
    167
    We did some additional benchmarking. The original benchmark had one caveat, we left VSync turned on, so it skewed the data, the new benchmarks are with VSync turned off.

    The general conclusion is that on three different Windows machines we see a degradation in average and median frame duration by about 1 ms. On a Macbook Pro we see we see an improvement by 3-4 ms but on that same machine connected to an eGPU we see a degradation by 5 ms.

    Below are the results for one of the Windows machines. Numbers after -> are for 2021.2.0b6.
    The results were very similar on all three Windows configurations even though they had very different CPUs and GPUs (including one Radeon).

    And here are the results for the Macbook Pro with an external Radeon:
     
  8. oobartez

    oobartez

    Joined:
    Oct 12, 2016
    Posts:
    167
    hippocoder and Lars-Steenhoff like this.
  9. NicoLeyman

    NicoLeyman

    Unity Technologies

    Joined:
    Jun 18, 2019
    Posts:
    33
    So Depth Priming is very project/scene dependent when it comes to performance gains/loss.
    I assume you do not have any SSAO (or post processing effects dependent on scene depth) enabled and/or you are using MSAA ?
    If so forcing Depth Priming makes you pay the cost of a depth prepass and a resolve pass for the MSAA depth.
    If your scene doesn't have enough opaque overdraw and/or expensive shaders you won't be able to overcome the added cost of Depth Priming to see any gains sadly.
     
    Ruchir and LeonhardP like this.
  10. Charlicopter

    Charlicopter

    Joined:
    May 15, 2017
    Posts:
    125
    2021.1.25f1 => 2021.2.7f1 upgrade: Drastic decline in performance (editor & builds). No change to project, just a direct upgrade and test.
    VR.
    2021.1.25f1 can handle the game at 144hz with plenty of headroom. 2021.2 can't even handle 90hz.
     
    unity_t3wnluhJrK3Ptg and adslitw like this.
  11. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,636
    yeh somehow my game is running like 50% slower in 2021.2.16f compared to 2021.1.24f. Very strange, i did upgrade to dx12 too so I cant be sure what it was like before but it felt sluggish.
     
    Charlicopter likes this.
  12. Charlicopter

    Charlicopter

    Joined:
    May 15, 2017
    Posts:
    125
    I have no idea how to get Unity to repro this problem. It only seems to affect certain machines at work. It runs fine on some lower-end laptops, but on others it just bogs like crazy :(
    Can you think of any way to get Unity to see this?
     
  13. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,636
    Swapped back to dx11, speed up a lot but still not like it was. Yeah, submit a bug report, I know a couple of guys too I will message them, but nearly always they say submit a report, which never goes well for me :)

    Im looking through the masses of hdrp options thinking some might be on by default that werent beforee maybe. Right now still trying to speed it back up. Interesting how it runs on lower end laptops, got 2080 here and i9 and seems quite a bit slower. dx12 was a shock, super slow.
     
    Charlicopter likes this.
  14. vinnygombici

    vinnygombici

    Joined:
    Dec 16, 2015
    Posts:
    25
    Hello, did you find the fix to your problem, I seem to have the same issues.

    Thanks!