Hello, I’ve been developing my game for around 8 months, I don’t ever recall having this problem for the first 6 months of development, actually I’ve never experienced this issue once in the past 5 years of using Unity. But now all of a sudden I’m getting huge frame drops, I’ve profiled this issue and all I’m seeing is Semaphore.WaitForSignal taking 22ms. This only seems to happen in the Built Standalone version!
I’ve spent 3 days now optimizing things and have seen slight improvements, yet the problem still remains there.
Everythings going great for around 2-5 minutes then the game has frame issues every 10 seconds or something then goes back to normal frames, then does it again?
Not much has changed on screen through this last 2 months apart from a few little things, mainly code changes which isn’t the issue whatsoever, the ‘renderer’ in the profiler spikes way above anything else and I can’t figure out why, its literally game breaking and not a pleasant experience to play the game.
I’m like 99% sure I haven’t changed any of my shaders since the start of time of development as well, they was the bedrock to my level design, my vert count is like: 5k, the tris count is like: 2k. There is only about 200 max game objects in scene at one time (Not on camera all at once either)
Vsync seems to stabalize the issue a little and has reduced the 22ms timer to around 14ms.
I’ve attached the profiler to my standalone build so I can profile during gameplay
I am having something similar to this, but on Android. I created a thread on my problem, so you may get some kind of answer there someday.
Looks like it may be some kind of hidden VSync in newer Unity versions, however I am not sure whether it is the case for PC Standalone, you should try to display your Time.unscaledDeltaTime with Profiler disabled. It may show repeated values during these lag spikes.
Thanks, I’ve literally scanned every english google post Ive found and none of the solutions work, yours is a new post so I’m hoping you get some answers, If you do please reach out too me and I will do the same if I find a solution
Like I said previously I’ve never encountered this issue in the 5 years of game development I’ve done over countless projects but for some reason now its happening, pretty annyoing when you can’t even debug the culprit in the profiler
Well, I received an answer on my thread. This is still quite mysterious, but perhaps they indeed made same improvements and fixes in rendering that affect performance, so I decided to move on and wrote lower quality shader variants and other optimizations, so performance got better.
I still hope, you found or will find the solution.
Hierarchy View is pretty bad for analyzing issues within the rendering pipeline, as it only shows one frame and one thread at a time. Timeline View is way more suited for this purpose, as it shows the Render Thread as well, and how the rendering and (GPU) present times spread from frame to frame. We’ve created the Profiler Marker Documentation for Rendering samples and Multi threading samples like Semaphore.WaitForSignal to bring some attention to this but still need to bring that clarity back into the tool itself.
Generally speaking, and as mentioned for these samples in the documentation view, this sample taking a lot of time hints at a bottleneck in either your Render Thread or on your GPU. So after looking at this situation with the Timeline view, you might want to look at it with the GPU Profiler, Frame Debugger, Render Doc or possibly a Graphics Card specific Profiler like NVIDIA Nsight Graphics, [AMD uProf](http://AMD μProf), or Intel Graphics Performance Analyzers.
Given that you stated that the displayed content doesn’t change when this happens, I suspect you might get the most millage out of these specific GPU profilers as it may be down to your PC’s or GPU’s power management. I.e. that your hardware is getting down-clocked for some reason.