This is Part 2 of the Fast Profiling series. There is also a Part 1, where I was talking about stat commands.

TLDR: read rule 7 from the Consistent Testing Environment section and the entirety of the Launch Parameters section.

Consistent Testing Environment

Before we talk about launch parameters, I believe it is very important to understand what is the best way to collect your performance data. If you know this already, skip to the next section.

  1. Have your build ready; do not collect PIE (play-in-editor) data. The editor has an extra overhead that will mess up your performance numbers.

  2. Ideally, you create and use a Test Configuration for profiling. This is because the Development Configuration has some things turned on for debugging that create overhead. You can read about available configurations here.

  3. Profile on a target platform, i.e. it is pointless to profile a VR game on PC. But, as pointed out by Jan Mróz: ”Some GPU tasks impact frame time linearly, especially on mobile, where memory bandwidth is a big bottleneck due to slow VRAM. If you're limited by pixel count, the main fix is lowering output resolution. Matching the game view resolution and FOV in the editor lets you use the native profiler directly, skipping the slow build–launch–profile loop”.

  4. If it is a PC game and you have PCs with hardware dedicated to a specific scalability, collect performance data on those machines. Usually, studios will have some build machines available to use for profiling, but if you are an indie dev, it might be helpful to buy a weak laptop and emulate a low-spec PC, a handy tip from Ben Cloward. This way, you can profile for the lower-end machines and make sure the game runs at the target fps on low settings.

  5. If you want to compare two profiling datasets, ensure that the hardware and launch parameters were identical during data collection. If those are not identical, then your AB test is not valid.
    AB Test - a comparison of two versions of the build, usually with a specific feature being compared to a build without said feature, to figure out the cost of the feature. There is also a handy stat command called abtest , which alternates the specified cvar between the two given values, abtest <cvar> <ValueA> <ValueB>. To stop the test, use abtest stop command.

    image.png

  6. To ensure consistency, run the same test 3-5 times. Usually, the first time you run the test, some shaders are still being compiled and thus affecting the profiling numbers. Running the test a few times will ensure that the runs are more or less stable. If you have destruction of VFX triggering, you will still see some inconsistencies at those places. But if you run the test a few times, you can select data that is an average or a median.

  7. If you are using your own PC for profiling, make sure you do not run random sht that creates overhead and messes up the profiling data.* Different processes require resources, and you want to have a clean slate so it is comparable with other times you’ve done profiling.

Launch Parameters

The launch parameters described in this section are basic good-to-know parameters. There are more useful launch parameters if you want to capture trace files; the trace file capture is out of scope of this article, hence I won’t describe those additional launch parameters here.

Let’s start with the command-line args*.*