[Optimization]Both game thread and rendering thread wait for task


Unreal insights tells that both game thread and rendering thread are waiting for task for more than 60ms.
What does it mean? How do I make it optimized with this infomation?

5 Likes

Have you found a solution for this issue? I’m experiencing the same problem and my insights view look basically identical to yours.

1 Like

I have the same problem, any ideas on this and how to solve it?

Did you solve the problem?I have the same problem

Also having the same issue u.u Any heros out there?

Identify which specific tasks are causing the delay by drilling down into Unreal Insights.
You can optimize those tasks, split them into smaller tasks,
or offload more work to asynchronous threads (e.g., AsyncTask, FAsyncTask, FTaskGraphInterface).

    • Ensure that any operation that doesn’t need to be on the game thread is offloaded.
    • Unreal Engine provides asynchronous loading for assets (LoadPackageAsync), network operations, and more.

Minimize the use of locks or synchronize access to shared resources in a more efficient manner. Consider using lock-free data structures or redesigning your architecture to reduce contention.

Use Trace Events to gather detailed information about specific parts of your game’s execution:

  • Open the Editor Preferences.
  • Go to Performance.
  • Ensure that Trace Events are enabled.
#include "Trace/Trace.inl"

void SomeFunction()
{
    TRACE_CPUPROFILER_EVENT_SCOPE(SomeFunction);
    // Or
    TRACE_EVENT("MyCustomEvent", SomeFunction);
    // Or
    UE_TRACE_LOG(MyCustomChannel, SomeCustomEvent, Channel)<< SomeValue;
    // ... Your function code ...
}
    • Then Open the trace file (.utrace file) that was recorded during your application’s execution in Unreal Insight and recheck.
1 Like