Profile-Guided Optimization (PGO) results with Unreal Engine

Hi!

I make research about Profile-Guided Optimization (PGO) effects on different kinds of software. My current results are available here: GitHub - zamazan4ik/awesome-pgo: Various materials about Profile Guided Optimization and other similar stuff like AutoFDO, Bolt, etc.

As far as I understand, UE supports PGO since the 4.27 release (Unreal Engine 4.27 Release Notes | Unreal Engine 4.27 Documentation) but I was not able to find more detailed performance numbers regarding PGO effects on UE itself and UE-based games. The only mention is in the Release notes above about some 10% performance improvement in some unknown scenario.

If you have some exact numbers for PGO results with UE (maybe some more brief benchmarks) or an example of a UE-based game with PGO - please share it here. Would be awesome to see more PGO results.

Thanks in advance!

1 Like

Hi, using PGO with UE4 is pain in the ■■■, but I made some tests on Win64, most of the setup for PGO must be made manually it isn’t even documented, my knowledge came from reverse engineering UE4 / UE5.

AFAIK UE5 should be more friendly with PGO: compile, profile, compile and move on.

My setup:
AMD Ryzen 9 3950X 16-Core
AMD Radeon RX 5700 XT
32 GIGs for RAM

For PGO profiling I did automatic camera sweep scanning over map from my game, nothing special, no real gameplay from replays - AFAIK EPIC profile PGO from replays in Fortnite.

Here are my results, binary was compiled in TEST configuration:
NO PGO:
image

After PGO OPTIMIZE:
image

Compilation with -PGOOptimize told me this:

1>Generating code
1>
1>12 of 12 (100.0%) original invalid call sites were matched.
1>69 new call sites were added.
1>341 of 1047744 (  0.03%) profiled functions will be compiled for speed, and the rest of the functions will be compiled for size
1>6521668 of 11199018 inline instances were from dead/cold paths
1>1047738 of 1048195 functions (100.0%) were optimized using profile data, and the rest of the functions were optimized without using profile data
1>19913884107 of 19914068655 instructions (100.0%) were optimized using profile data, and the rest of the instructions were optimized without using profile data
1>Finished generating code

PGO Pros:

  • So it seems PGO did something, according to stats the game runs faster.

PGO Cons:

  • This is very time consuming: compiling binaries, profiling, compiling binaries.
  • If you do not have tools to simulate realtime game behaviour(REPLAYS) with player input, you will not probably be able to generate reliable profiling PGO data.
  • UE4 PGO setup is pain in the ■■■.