So I upgraded my project from Unity 5.1.1p3 to 5.2, and I’ve noticed that the performance seems to be off. For the most part it runs nice and smooth, then it seems to enter a state where a smooth pan (in game or in editor) has a ‘pulsing’ quality – almost like it gets hung up every fixed update or such. To be clear, the framerate doesn’t drop, and it’s not even like it has a hitch / dropped frame… it’s more like briefly but smoothly slows down slightly every 0.25 seconds or so.
This is also quite inconsistent – sometimes this happens as soon as I start playing in editor, other times after some new objects have been added, and other times it goes away after playing for a while. The states last a fair amount of time – so it’s either pulsing and not running smoothly, or it snaps and the starts running perfect for minutes – then it starts pulsing again. When it decides to run smoothly, the performance is comparable to 5.1.1p3.
I also started a new VR project with Unity 5.2, and the pulsing is present there as well. The scene is extremely empty, and almost no script at this point, but the pulsing is still noticeable – and while subtle, it can be very uncomfortable in VR. In my other project, the pulsing seems relating to CPU load – so where we’re normally at ~ 4.3 ms (in 5.2 – more on that later), when things get busy it gets up to 7-8 ms, and the pulsing starts to feel really disruptive. What’s odd though is it’s not direct dropped frames – it’s almost like the physics slows down and the render thread updates normally. We’re using 2d physics.
To exasperate things further, my project uses ReadPixels to get some material back from a custom shader setup. The Texture2D is small, and the performance has been bearable – about 2-3 ms per fixed update in Unity 5.1.1p3. (at least this is what I see in the profiler – and even with the profiler open the game runs smoothly). In Unity 5.2, when I open the profiler the gfx.read event is now taking 140 + ms, and the entire game becomes an unresponsive mess. When I close the profiler, it goes back to normal – occasional pulsing states and all.
In Unity 5.1.1p3, my CPU time is ~ 2 ms per frame, and there is no pulsing. I can have a rather busy and complicated scene, and I will barely hit 4-5 ms. In Unity 5.2, my CPU time is starts at ~ 4.3, quickly rises to 6-7 ms as soon as I add anything more than the player, and often enters into the pulsing states described above. (the pulsing states do not reflect on a change in the reported frame time, though the intensity of the pulse does seem worse with higher CPU frame times).
To be clear, while it looks like the script with ReadPixels has slowed down substantially and is likely responsible for most of that CPU difference, we notice the pulsing on a scene with absolutely no ReadPixels calls.
I’ve disabled all the Realtime GI, and can’t think of any other system it might be. We do not have any GUI work at this time, though I do have some sprites in the scene.
I am working on an NVidia GTX 670m, i7, and 12 GB worth of RAM. My Colleague noticed a similar phenomena on his machine with the same empty VR scene.
Any input would be appreciated, as right now the performance is painful enough for me to fall back to 5.1.1p3 L