Introduction to using Unreal Insights Profiling with C++ - UE C++ Tutorial

preview_player
Показать описание
Unreal ships with a powerful profiling tool called Unreal Insights.
You can quickly iterate and test ideas using scope cycle counters and unreal insights.
Here I show how to define some quick scope cycle counters to measure a function or block scope.
I show how to capture the profile data in the editor, and in a standalone client.
I show basic usage of the insights tool to view measured durations of scope counters.
I show how to package a game for a more accurate profile capture.
Then compare the editor to the standalone performance, of similar profile tests.
Lastly we talk about how to think about these numbers and make comparisions using the insights capture.

NOTE: I have a bad habit of using the word "marker" to mean "scope" or "timer" or "counter".
But "marker" is probably the wrong word to use!

References:
Stat System Overview

0:00 Video Preview
1:19 Intro - The previous test
1:44 Adding quick scope cycle counters for profililng (QUICK_SCOPE_CYCLE_COUNTER)
2:45 Running the profiling test in the editor
3:05 Accessing Unreal Insights Session Browser in the editor
3:18 Unreal Insights Session Browser
3:40 " Stat NamedEvents " (no quotes) is needed to capture our named stat events
3:52 Starting a capture (the red button)
4:20 Stopping the capture
4:25 Renaming capture in session view
4:35 Opening up the capture session
4:44 Viewing our stat counters / timers / events / markers
5:15 Adding new columns to the timer summary view
5:25 Inclusive vs Exclusive times
6:03 Opening up a previous "editor" recording capture I did to validate it has similar timings
6:27 Packaging the game to get a more accurate capture than profiling in the editor PIE session
7:14 Capturing a profile session on a development build standalone game
8:10 Opening up the development stand alone trace for review
8:48 How to use Unreal Insights Search
9:00 Closing before spread sheet analysis
9:18 Note there is some overhead of capturing with scope counters
9:40 How to think about these numbers -- reasoning about frames per second vs durations
9:50 Setting a millisecond budget targeting 60 FPS (frames per second)
10:27 Setting a milisecond budget tareting 30 FPS
10:50 Comparing results against a 30 FPS budget, is it over budget?
11:29 Closing summary
11:40 Outro
Рекомендации по теме
Комментарии
Автор

This video is so useful, thanks again for making this! Do you know if we can capture a session of a shipping build (even without console commands)? Insights will automatically capture a session of a development build but not a shipping build...

peacesells
Автор

Hi! What is the simplest method to evaluate the performance or speed of execution of a function?

РусланСчастливый-рь
Автор

AMENDMENTS / NOTES: Here I used a console command which kept this to a single frame. So I could like at the total "inclusive time". But for most things, you will want to enable a column for inclusive averages, and use that. (5:15) eg I, Avg and I, Med

I forgot to mention, you can highlight a region and get a "count" for your stat. So if you highlight a single frame, you can get an idea of how many times your function is called in a single frame. Or can highlight a relevant region and just get an idea of the number of calls in that region. The stat count can give you an idea of it being worthwhile to maybe optimize by reducing the number of calls -- or optimize via caching intermediate values for the current GFrameCounter. (see {, , UnrealEditor-Core.dll}GFrameCounter in your watch window). But becareful with caching as the value can become stale easily, especially if function is called too early in the current frame. Also caching as a member variable is preferred as global variables may be shared in PIE testing.

enigma_dev
visit shbcf.ru