How do I actually use Unreal Insights to efficiently find blueprints and functions that are slowing down my game thread?

Right, so at this point I have gone through several hours long videos on Unreal Insights from Epic and other Youtubers and I just can’t seem to be able to use Unreal Insights properly.

I use RenderDoc for GPU profiling and it’s so easy to locate EXACTLY the blueprint/function/material/texture/pixel that’s causing latency. The GPU Visualiser also helped me alot in profiling the GPU.

But for CPU profiling, I haven’t been able to find a tool that is similar in simplicity. I have been trying to learn Unreal Insights to profile my CPU game thread but it’s so ■■■■ complex. I’ve gone through multiple hours long videos and they all seem to be showcasing its features rather than showing me how to locate which function on the game thread is causing a delay.

I’m trying to use the City Sample Crowds pack in a marketplace crowd spawning system and I know the City Sample is too heavy for game development, that’s why I chose it so I can learn CPU profiling.

I spawn my vehicle pawn (80-90 fps, game thread 11.02ms yay)

I go towards the crowd spawner, it spawns some characters from the very heavy City Sample Crowds pack (~40 fps hmm)

I go even further into the crowd and have more people spawned (~20-30 fps, game thread 34.26ms boo)

So I go to my Editor Preferences, Standalone launch parameters and put in the CPU Profile Trace parameters “-cpuprofilertrace -loadtimetrace -trace=default,memory,metadata,assetmetadata”

And I launch Unreal Insights and my game in a standalone instance. Unreal Insights starts collecting data, I close all other tracks except Game Thread and I immediately see where the issues are.

This function takes 15 seconds when loading the crowd characters for the first time. (See I even learned to use Trace Bookmarks!)

Sometime during the game where my FPS hit a low of 13, I focused on that frame and all I see is this jumble of lots of events

That’s as far as I understood, afterwards, I just don’t know how to locate these functions, it just has generic names on everything like Function, Blueprint, ComponentTick, etc.

How do I actually profile my game thread? Is there any simpler method so that I can identify my bottlenecking functions, fix them and get on with my development? I’ve been stuck here for the past 3 days

2 Likes

you can create a custom events in c++ with: TRACE_CPUPROFILER_EVENT_SCOPE_STR("My custom event name"); not shure if that is what you are looking for

1 Like

But I don’t know which event is heavy… how do I find that out?

Screw Unreal Insights. The Session Frontend does the job for me. I had a massive spike in game time when I was forming ice in the level after rain but had no idea why it was happening now. It worked fine before.

After ice formation:

So I use the console command stat startfile to start recording while this is happening during play and then use stat stopfile to stop recording after a few seconds.

I launch Session Frontend from Tools > Session Frondend

I go to the Profiler tab and load the stat dump file: (ProjectFolder/Saved/Profiling/UnrealStats)


I click on the peak in the Graph Viewer and the Event Name tab shows me the most time consuming threads aka the Render and Game Thread.

I know that the Render Thread is affected by any hitches in the Game Thread so I start expanding the Game Thread:

And it shows me exactly what actor is causing this hitch. In my case, the Radar Sensor. Which immediately told me what was going on, because I coded it like this.

I had designed the Radar Sensor to trace for all actors with a few exceptions, and when I spawned the ice sheets, it started picking up hundreds of ice sheet BPs and went berserk. This wasn’t an issue before because I built the Radar long after I built the ice sheets and forgot all about it till I changed the weather and rain started becoming ice.

THANK GOD, FINALLY SOMETHING RECOGNIZABLE IN THIS WHOLE PROFILING DEBACLE. I never would have guessed it was this BP causing an issue if it weren’t for the Session Frontend.

I hope this helps someone out in this weird and ominous world of profiling. Thank you for coming to my TED Talk.

15 Likes

I am trying this very same thing. Insights is just so ■■■■ cumbersome. I saw a video on exactly what you were doing but my “profiler” tab is not showing. Anyone know how I can switch it on? I tried looking at all settings and did some research and I think I need to run a command to enable the “profiler” tab. I have been on this for 4 days…trying to find out what is killing my performance.

Just looking for how to turn on my profiler tab.

3 Likes

For those looking for it in 5.3 it was retired , but you can use 5.2 and load 5.3 profile save files there. Insights is just too bloated.

2 Likes

Did you try the Session Frontend method? I’ve found absolutely no use for Unreal Insights till now.

For that command you were looking for, I used these commands:
-cpuprofilertrace -loadtimetrace -trace=default,memory,metadata,assetmetadata

They go in Editor Preferences > Level Editor - Play > Additional Launch Parameters textbox.

Another reason not to switch to 5.3

Yeah. I tried the front end in 5.3 but it was retired. I successfully used frontend in 5.2 and was able to locate some of my processing time issues.

1 Like

yep. Session frontend was removed in UE 5.3 but you still can use it with source engine build (how to: check 5.3 changelog page)
And I don’t recommend enable it. If you need profile blueprints with unreal insights just enable this checkbox (see screenshot)

8 Likes