So I have noticed that turning off thread sync will give me a really good fps boost, but does the latency give me such a disadvantage that it is not worth that extra fps?
Should I turn thread sync back on?
Thread Sync Disadvantage?
Below is a snippet of what it actually does.
TL;DR it’s not a very noticable issue as long as your FPS is high (120+), because the one frame thread lag would be 1/120th of a second. It would become more noticable in lower FPS counts, though that really shouldn’t happen. If it would, I’m pretty sure your FPS without OneFrameThreadLag would be abyssmal to begin with.
Ok, here goes. Since this comes up quite often, I’ll try to be as detailed as possible.
First some background. The game runs essentially on 2 main threads - a game thread and a rendering thread. The game thread calculates all gameplay aspects such as shooting, hit registration, animation, IK, etc. The rendering thread calculates shadows, updates particle systems (such as smoke), and sends all the draw calls to the GPU for rendering.
Although for most parts the rendering thread can run on its own, it is not entirely independent of the game thread. The game thread “tells” the render thread where your camera is so that the rendering thread can draw the environment from your current location. Another example would be when you shoot, the game thread evaluates your mouse click, computes the ballistics, and if it hits a wall, it “tells” the render thread the location where it hit so that the render thread can draw a bullet impact decal at that location.
Because of this, the game thread needs to “talk” with the render thread. However, it cannot do so anytime it wants (effective threading simply doesn’t work that way). So, it syncs from time to time, but otherwise goes about its own business. This sync time is usually at the end of a frame.
Now, let’s assume that your game thread is running faster than your render thread. The game thread computes the Nth frame, sync happens, and then your render thread renders your Nth frame. While the Nth frame is being rendered, the game thread can compute your (N+1)th frame in parallel. By the time the (N+1)th frame is finished by the game thread, the Nth thread MAY or MAY NOT be finished by the rendering thread. This is where “One Frame Thread Lag” comes in. If OFTL is off, the game thread will STALL at this point, waiting for the render thread, resulting in a performance drop. But, if you play with OFTL turned on, it will allow the game thread to queue up the (N+1)th frame and start working on the (N+2)th frame immediately, and the render thread can pick up and render the (N+1)th frame once it has finished rendering the Nth frame. This gives you MORE PARALLELISM, and hence better performance. Keep in mind that this will only happen for one frame - your render thread will NOT keep falling behind more and more as your game progresses.
[quote=“Matuno;175444”]
-snip[/quote]
Thanks yeah it boosts my fps from a max of around 80 min 50 to around a max of 120-130 on medium settings, I really hate those fps drops below 60 because it just puts you off for that fraction of a second.
Yup, pretty much what Matuno said. At 60fps one frame of animation takes 16.67ms to render on your screen. So, even if you were losing 16.67ms, it’s not a huge time loss and you not only get the benefit of higher FPS but also less hitching. Then if you get a bump up to 120FPS with it on you’re only losing 8.3ms. I run at 144FPS locked so I’m only losing 6.9ms in order to keep my FPS constant without frame hitching.
It’s an extremely good trade-off that scales very well with higher FPS. Everyone should make sure they are playing with threadsync on.
[quote=“Amerika;175543”]
It’s an extremely good trade-off that scales very well with higher FPS. Everyone should make sure they are playing with threadsync on.[/quote]
What do you consider as higher FPS 60+ ?