Search Unity

Unity editor performance drop when losing window focus

Discussion in 'Editor & General Support' started by Zergling103, Feb 22, 2018.

  1. Zergling103

    Zergling103

    Joined:
    Aug 16, 2011
    Posts:
    392
    I want to test my project, and have muliple instances of the editor running for networking purposes. (I use folder linking to have multiple editors editing the same project at the same time.)

    However, I need to have all instances of the editor running at full speed in order to test properly. (I have enough CPU and GPU power to do this.) However, while the editor instance that I currently have focussed runs at 60+ FPS, the others throttle down to ~30 FPS.

    Is there anyway to disable this effect? Or do I really need to get another computer just to test my game?
     
  2. surajsirohi1008

    surajsirohi1008

    Joined:
    Jun 21, 2016
    Posts:
    267
    Yes, the more scenes windows you have, lower the fps. You need more powerful computer.
     
  3. NullQubit

    NullQubit

    Joined:
    Jun 1, 2015
    Posts:
    11
    Did you find a solution to this problem?
     
  4. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Windows is in charge of scheduling processes on the CPU, and automatically increases effective priority to an application which is in focus. You can try adjusting process priority in the Task Manager's Details tab. Though if your computer doesn't have any bottlenecks preventing 60+ FPS on all instances, then that's what they would likely already be running at.

    You could try using Application.targetFrameRate to cap your game at 60 FPS, so the instance in focus frees up the CPU/GPU for the other instances instead of running higher than 60. You could set this only when run in the editor so it won't affect builds.
     
    Last edited: Aug 28, 2020
    PraetorBlue likes this.
  5. shelim

    shelim

    Joined:
    Aug 26, 2017
    Posts:
    29
    Sorry for necroing this, but I just came from Google (with no avail), but I found solution myself (on my GeForce card):

    (Note that I am translating steps from Polish, there might be some discrepancy)

    Start -> NVidia Control Panel -> 3D Settings -> Manage 3D settings -> Application settings -> Add -> Unity Editor / Your game build -> 2. Preffered GPU (High quality) -> 3. Limit FPS / Limit FPS in background mode -> change to "Set / 60 FPS".

    Do not be fooled by Limit FPS in background mode set to off! Windows is kind enough to apply the limit even if it is off in this screen, and the default value for background rendering is only 25 FPS.

    See a screenshot as guide:
    upload_2022-9-24_23-36-25.png
     
    Whatever560 and stonstad like this.
  6. stonstad

    stonstad

    Joined:
    Jan 19, 2018
    Posts:
    659
    As a heads up, for the above steps to work all open unity.exe processes need to be closed and restarted after changes to the NVidia control panel are applied. Hope this helps the next person down the line.
     
  7. dkriver

    dkriver

    Joined:
    May 25, 2021
    Posts:
    3
    I've not managed to get this to work currently. Prefered GPU doesnt exist as an option, but 'Background Application Max Frame Rate' does exist. Set to 60fps if I unfocus the Editor, refocusing it still taking a few seconds before I can interact with anything - which adds up quickly over a day!