@MartinTilo
I got a response to my bug report but unfortunately the QA rep that responded, with no disrespect to him, must have either misread or misinterpreted everything I wrote because both his worded and video response focused on replicating the scenarios that I had specified were behaving normally instead of replicating the scenarios I had specified were behaving abnormally. I responded to him with extra detail to clarify, but Iâll clarify a bit more here as well with video examples just in case there was a similar confusion; sorry for any repeated info.
- When NOT in play mode and editor is either in focus or out of focus, everything is normal, whether profiler is recording or not.
- When IN playmode and editor is IN focus, everything is normal, CPU is <20% whether profiler is recording or not.
- When IN playmode and editor is OUT of focus, CPU skyrockets to 100% whether profiler is recording or not.
This (3) only happens with 2020.1+. I tested with 2018.3, 2019.1, 2019.2, 2019.3, 2019.4 and the issue does not occur. I even made a 2019.x project where it consistently did not happen and updated that same project to 2020.1 and it started consistently happening immediately.
Hereâs a video to showcase my experience on my PC with the same project I used for the bug report.
Because it can be a little confusing, at the start of the video before I showcase the problem, I quickly swap focus back and forth between each window just so you can easily determine later in the video which window is in focus at any given moment. The window that isnât being overlapped is the one with focus.
Also, during the test I toggle profiler recording as well just to show that it has no impact on the issue Iâm having. Also UNRELATED to my issue, in the video when I gesture over the profiler when out of focus, itâs to highlight that the profiler stops updating when the editor is out of focus (except as you can notice, the occasional mouseover event even when out of focus will trigger a repaint). I donât think this is related to the problem because this behavior is common for all Unity versions Iâve used, including both 2020.x AND 2019.x and even as far back as 5.x, with the ONE exception being 2019.4 which oddly updates properly when either in or out of focus.
(The same still happens for standalone profiler even though itâs a separate process, it just stops updating when editor is out of focus, again except for 2019.4)
k8n6b1
As you can see in the video above, when Unity Editor is in play mode and out of focus (as in when I click on task manager in this video), unity editor CPU skyrockets. It then immediately drops as soon as I click back onto the Unity Editor and it regains focus. The video above completely demonstrates the problem I reported.
HOWEVER, I want to show you another video of the profiler specifically that could be very relevant to the bug I reported. At the start of the video I will profile the editor this time, and I want you to keep a close eye on the number frames that the profiler has recorded when in the 4 states below. I tried to gesture with my mouse after each subsequent âmodeâ, those modes being:
(1)playmode OFF focus ON (occurs between 0 and 32 seconds in video, seems normal)
(2)playmode OFF focus OFF (also occurs between 0 and 32 seconds, seems normal)
(3)playmode ON focus ON (between 32-42 seconds, seems normal enough)
(4)playmode ON focus OFF (starts at 42 seconds, canât be normal)
0j1yn4
As you can see, nothing out of the ordinary in the first 3 scenarios. But as soon as I do (4), where I click OUT of focus when playmode is ON, when I click BACK into focus, the profiler had recorded tens of thousands of frames in the background during just the 2-3 seconds I was out of focus. This does NOT occur with 2019.1, 2019.2, 2019.3, or 2019.4, and only occurs on the unity versions that are having the problem I reported, which leads me to believe it could be connected somehow. And itâs why I think itâs an issue of the framerate not properly being throttled in some way in scenario (4), because the editor framerate IS being throttled in scenario (2), which is also out of focus. Even though I think theyâre connected, let me clarify that I donât think the profiler is any root cause of the problem because the problem still occurs when the profiler is not recording. I just think that the profiler recorded framecount (not framerate) from scenario (4) in the second video above demonstrates the problem is affecting the profilerâs behavior. Itâs also reflected in the framerate, but itâs much harder to demo that in the video, and I think just the frame count is more than plenty.
If this issue is only happening to me, then all I can guess is that it could potentially be the way Unity is interacting with my hardware somehow.
My CPU is i5-8400 and GPU is Nvidia GTX 1050 if that helps.
Thanks so much if you can find time to look into it but absolutely no worries if you canât because itâs not that big of a deal for me to just not leave it in play mode in the background.