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

Bug [IN-26965, UUM-26990]Game View UI eating x10 more CPU

Discussion in '2023.1 Beta' started by Kamyker, Dec 21, 2022.

  1. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    1,091
    Update, upvote: https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-26990

    ---------------------------------------------------------------

    I upgraded my project from 2021 to 2023 to use MPPM package. Something weird is happening with editor. After 15-30 mins of using editor and going to play mode few times performance drops drastically (from 150 fps in first playmode to 10 fps after 30mins). Could Game View be finally upgraded to UI Toolkit to remove this massive 16kB alloc every frame???

    Play profiler:

    Editor profiler:


    GameView profiler (from the one above):

    DoToolbarGUI takes 10ms of cpu, how's that possible?
     
    Last edited: Feb 22, 2023
  2. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    1,091
    Same story with profiler, these hiccups make it unusable and I don't have a bad cpu (i9 9900k).
     
  3. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    1,091
    I've learned how to redirect methods and I was right. Hiding GameView toolbar, background (that's invisible anyway), tabs increases performance by 90%, cpu usage goes from 10ms to 1ms.

    Also tested Unity 2021 and somehow it only takes 1ms there. My script further improves it to 0.3ms.

    Left optimized, right default Unity 2023.


    Video with 90 to 600 fps here: https://twitter.com/kamyker/status/1605832525825335297
     
    Last edited: Dec 22, 2022
  4. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    1,091
    There are even more regressions, prefab selected and W pressed in playmode to move character. Somehow whole inspector gets refreshed and fps drops to 5??
     
  5. Jonathan-Westfall-8Bits

    Jonathan-Westfall-8Bits

    Joined:
    Sep 17, 2013
    Posts:
    271
    I would like to double down on this issue.

    This is a really bad regression. Play testing in a minimal 2D project is sometimes reaching sub 5 frames per second.
    Currently having the exact same issue as the original poster.
     
    ModLunar likes this.
  6. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    1,091
    Reported it as a bug few days ago, wasn't confirm by Unity yet: IN-26965.
     
    TreyK-47 likes this.
  7. boyaregames

    boyaregames

    Joined:
    Jun 23, 2021
    Posts:
    76
    the more i go in game mode the less i got fps every time
    i have to reopen unity every time
     
  8. ModLunar

    ModLunar

    Joined:
    Oct 16, 2016
    Posts:
    374
    I'm glad others are finding and bringing this issue up, -- my editor has been slowing down to a crawl and it's literally a blank 2D project with 3 square sprites, and one 64x72 pixel art character (no animations even in yet) haha.

    It's the same issue here too -- just reproduced by having Unity open for around 30mins+ and entering/exiting playmode.
    At first, the GameView stats window shows 200+ FPS, and slowly goes down to around 10-20 FPS.
     
  9. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    1,091
    Bug report still not reviewed...
     
  10. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,822
    @LeonhardP poked the QA team for ya about this
     
  11. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    1,091
    alexeyzakharov likes this.
  12. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,363
    2023.1 editor is way slower than 2021.
     
  13. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    1,091
    Forgot to mention to upvote the issue or we'll have to wait few years before it gets fixed :)
     
    laurentlavigne likes this.
  14. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,363
    Today's your lucky day, my vote counter is full haha! revenge! Oh wait, you can only give one point now. Well... anything else you need votes on?
     
    marce155, ModLunar and Kamyker like this.
  15. ModLunar

    ModLunar

    Joined:
    Oct 16, 2016
    Posts:
    374
    Err..?
    I've been using Unity and voting on their issue tracker for years.. but now their login process never registers me as logged-in, so I can't vote on the issue lol :(
     
  16. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    1,091
    Status: Fixed and currently awaits internal confirmation.

    Hopefully we will get better performance than <2022 if these small gc allocations from GUI every frame get fixed.
     
    ModLunar likes this.
  17. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,363
    It's that magic touch.
    I have 8 votes left, anyone? anyone?
     
  18. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    1,091
    It says bug fixed in "2023.2.0a8" but it's still pretty bad, especially allocation:


    I'll get 2021 numbers soon...
     
    ModLunar likes this.
  19. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    1,091
    2021:

    Higher allocation but somehow only 1.20ms vs 2.77ms in 2023
     
    boyaregames likes this.
  20. x2shadow

    x2shadow

    Joined:
    Jan 26, 2021
    Posts:
    1
    How about 247 ms in Unity 2022.3.4f1? :)
    upload_2024-2-25_7-8-57.png