Performance Profiling a.k.a. Say what now?

Hello there,

I am currently busy optimizing / profiling my project. I keep falling down to about 15 fps on my workstation and that is obviously way too bad.

I need to find the problem but since I am teaching myself, I lack the technical skills to really comprehend what is going on…

Before I get into it: The project is fairly simply. No Dynamic anything. Lightmass with small to hugh lightmaps depending on the object size. Skylight, directional Light.

Now, for example: I enable stat FPS and Stat Unit which helps a lot. I get the following stuff:

  •         13.65 fps (red)
           73.24ms (red)

Frame: 73.87ms (red)
Game: 5.57ms (green)
Draw: 73.88ms (red)
GPU: 73.88ms (red)*

I do not understand most of these values.

Is the value Frame how many ms Unreal needs to render 1 Frame? 13.65ms x 73.24ms = almost 1000 — The math checks out so I guess that is it.

Then I guess that Frame is the combined time of Game/Draw/GPU?
“Game” is functionality like blueprints and game mode / controls? This is I guess a CPU thread?
“Draw” is loading the assets (geometry and Lightmaps)? Does this involve the power of my hard drive or is this also CPU?
“GPU” is everything the graphics card needs to do to render the final images - i.e. interpret the lightmaps etc, basically the final render.

First the GPU
I have found the GPU Profiler and it gives me something very weird. When I open the profiler, the Draw instantly drops to almost nothing, like 1,6ms or something… Once I close the window it jumps back to the red value… What the…?

In the GPU Profiler he tells me that my lightmaps take forever. I do have a couple of fairly big Lightmaps, but I need those to achieve the visual quality that I want… but the performance kicks it… can I somehow influence this? I read something about streaming cache or something - Can someone elaborate?

Now about the Draw:
What exactly takes so long? Can i find a list of all the objects he loads? With stat.sceneRendering I just get a number of objects he loads which confuses me a bit because he tells me he’s loading in around 441 mesh draw calls and 435 static List Draw calls … I cannot believe that I am actaully looking at that amout of objects… what else does he open? Also the stat.SceneRendering has the Counters in the bottom lines and gives me a “present time” and the Mesh and Static list draw calls beneath it… but my Stat Unit gives me another Draw ms than the present time… what’s this?

And lastly Game:
It is no problem for me at the moment, but actually pretty much nothing happens concerning interactivity or whatever the Game thread does… so even 6ms seems a bit much when I compare screenshots to other projects I have seen… How can I check what’s going on here?

Thank you so far!
If I have overlooked a basic FAQ or a site in the documentation please me there… but the profiling stuff in the documentation goes fairly deep into actual coding which I would like to not do…

Oh and my specs are:
GeForce GTX 650
Intel i7 @3.2 GH / 6core Multithread 12core

Thanks alot and hope you’re having a good time!


This video should answer most of your questions:

Thank you! Will have a look at it now!

I defragmented my computer last night, because I found it being 25% fragmented… Now I opened Unreal and my Draw went down from around 80ms to 2ms <3

Is there a direct correlation or is this purely coincidental? Thanks alot!
EDIT:// ok yeah… back to before… what the…?

Purely coincidental, File fragmentation only affects the time required to read the file. <- And it is good practice to defrag every now and again :slight_smile:

Unless you are running off a SSD then never Defrag :stuck_out_tongue:

Quick question:

in this video, he profiles in standalone mode by typing things in the console… what do I have to do to enable the Console in my standalone game? I somehow cannot access the console in standalone mode…?

You need to use the Development build configuration instead of Shipping build configuration when packaging.

Do I need to setup a console in my game to access it ? Even in development build mode I cannot access the console … Or is there another box I need to tick?

EDIT// …this is annoying… I am close to creating keybindings to basic Console commands that I want to use -.-

Another quick question apart from the console in “standalone” play mode… Is there a way to override all materials with one click? I want to know if my performance increases significantly with very basic materials… I have realised I am using a BaseMat I bought and instancing it about which has 210 shader instructions…

Or Do I have to replace each material by hand …?

Still can’t access the console in a standalone game? With the tilde (~) or (`) key by the number 1? Strange. Keep in mind we’re talking about a standalone game from the editor and not a packaged game. The screenshot you posted above is packaging settings for a deployed project.

210 instructions is a lot of instructions if you are using it for almost every pixel in the game. Go to Lit > Shader Complexity to see how serious your instruction count problem is. Darker green is meh, red is bad, large amounts of white are an extreme problem. In the standalone game, you can also access these viewmodes from the console.

Get your framerate counter going, and open the console (~) and type in “viewmode lightingonly” or “viewmode unlit” or “viewmode shadercomplexity” or “viewmode lightmapdensity” or others. This will essentially override your materials just like you are asking about.

I would also like to know this, Perhaps it can be done in C++?
Could be possible if you can set the material via BluePrint/C++, Then a function that loops over everything could do it.
I think I will try this sometime this week(unless it has already been done/not possible).

You do not have to do any of that and can instead use the SHOW commands to hide and unhide entire sets of objects, like static meshes, to see what is causing your rendering issuses. To do this all you need to do is open up the Unreal Console by pressing the back tick / tilde key ~ and then in the commandline input SHOW Staticmeshes to turn Static Meshes off and then input it again to turn them back on. You can also use the SHOW Materials command to enable / disable the rendering of Materials.

This appears to do nothing for a development package of my game, But the static meshes one did.
What is supposed to happen when toggling materials?
BTW I am using 4.10.0

This is an editor / development only command. When you package all of the debug commands, like this one, are stripped from the game. What should happen is all the Materials in the level should go grey, however I have not tested this on a complexe sceen as if I have to do this type of testing I use something like NVIDIA Performance HUD or Intels GPU analyizer. If that does not work please let me know and I can look into something else for you.

Alright this is all great and all… but I still cannot access the console in standalone… am I too stupid? Since I am normally using a german keyboard layout, I switched it to english and tried - didn’t work. When I change the keyboard shortcut, it doesn’t work…

I am close to building a freaking text input that connects to an Execute Console Command in the Player Blueprint… this cannot be what I need to do, for crying out loud …

Please help because this is getting proper annoying -.-

Which button do I have to push or box to tick so I can access the console in standalone game mode (Not packaged)…

And quick firing another question:
Can someone tell me what I could be doing wrong that Draw, GPU and Frame are at exactly the same ms? There has got to be something wrong… ?

Oh and during the time of this graph I did not move the player whatsoever… yet still there is an amplitude… what is going on…?

Like other people mentioned : Just press Tilda, it doesn’t matter if you package for development, play in editor or standalone game. Sometimes when you are fullscreen you have to press it more than once to come down. Also you can check if it’s maybe out of your screen by typing some command like : Stat.fps and see if it works.

as I said before… there is no tilde on the german keyboard … if it were that easy I wouldn’t still be asking the question… The shortcut that works in the editor does not work in the standalone game …

But yeah…It seems like I’ll need to build an input widget connected to a execute command node … this is ridiculous -.-

Ok solved the Console thing…

for anyone else who is as blind as i am… under Project settings > Input > Console you can add another button to open the console… important for those who cannot/don’t use an english keyboard…