Quick answer: Unreal shipping build CPU profile dominated by log activity? Even when log output is off, UE_LOG arguments may be formatted before the verbosity check — guard expensive args.

A Verbose UE_LOG with FString::Printf args ran 1000x/frame; even in shipping the args evaluated. Game thread spent 4ms per frame on the formatting.

LogCategoryVerbosity Macros

UE_LOG’s verbosity-check is at the top, but argument expressions are evaluated either way. Use UE_LOG_CATEGORY_VERBOSITY or wrap callsites in if (UE_LOG_CHECK_VERBOSITY(LogXxx, Verbose)).

Conditional Formatting

if (UE_LOG_CHECK_VERBOSITY(LogGame, Verbose)) {
    UE_LOG(LogGame, Verbose, TEXT("%s"), *ExpensiveFormat());
}

ExpensiveFormat runs only when verbosity matches. Shipping with lower verbosity skips it entirely.

Compile Out via Macro

#if !UE_BUILD_SHIPPING wraps debug logs that never need to ship. Compiled out entirely; zero cost.

UE_LOG vs FName Categories

FName-based category lookup is faster than string. Use DECLARE_LOG_CATEGORY_EXTERN and the macro form.

Verifying

Profile shows minimal time spent in log. Even high-rate Verbose logs are skipped at low verbosity.

“UE_LOG args evaluate before verbosity check. Guard or compile out for shipping.”

Audit Verbose-level logs for expensive args before shipping — they often hide significant cost.