Low FPS when running the game in 2 Unity instances

Hello,

to test the online multiplayer mode of my game, I duplicated my project (while sharing the “Assets” & “Library\Artifacts” folders through Symlinks), and then I launch 2 Unity Editor instances and launch the game on both of them.

With only 1 Editor instance running the game, I get around 120 fps. If I launch another instance, the instance that doesn’t have the focus sees its fps dropping to 10~20fps.

If I use 1 editor & 1 build, both run around 70~80 fps, and are not affected by having or not the focus.

Anyone would know how to fix that behavior ? It makes it very hard to test when 1 editor instance runs much slower than the real thing… :face_with_spiral_eyes:

Notes :

  • the scene view is hidden ; only the game view is active
  • I use Unity 2019.4.20f1 ; it was the same with 2019.4.13f1
  • there’s no profiler nor profiling on (I think)

I have encountered that as well when running multiple editors a few pieces of advice I can give:

  • Lock your game to a low but acceptable framerate with Application.targetFrameRate = 60; That will give you an overall higher FPS in both editors because there’s less fighting for CPU resources.

  • There is a setting in Edit/Preferences/General called “Interaction Mode” setting it to “No throttling” can help with performance when running multiple editors.

  • Make sure the '‘Run In Background’ checkbox is checked in Project Settings/Player.

5 Likes

@luke-unity ,
only doing “Application.targetFrameRate = 60” was enough to get both editors running at 60 fps ! ('‘Run In Background’ was already checked)

Thanks a lot for your help ! :slight_smile:

Windows automatically gives the focused application a priority boost. So two otherwise identical applications with no caps on framerate, you should expect the focused one to be allocated more CPU time, which can result in a higher framerate.

3 Likes