There is room for optimization in UIUpdate(). This function executes any time a new screen pops in the stack, is called by the tactical controller events (event ForceUIUpdate() and event PreRender(), and during the pre-render phase.
What UIUpdate() does is execute any delegates that were enlisted per tick, so UI elements such as arrows pointing on a units head, Flag manager, watching for Fullscreen changes, etc. all rely on continuous execution for its logic
At best, while the game is idle, UIUpdate() wouldn't be much of an issue, but worst case it can tank the FPS quite a bit while the delegates are processing:

Aggregate for 10 seconds of gameplay (no loading between GameReplicationInfo)

UIUpdate()/PreRender() can be pretty intense during normal gameplay for lower end processors.
The current code for reference:
for( i=0; i<m_arrUIUpdateCallbacks.length; i++ )
{
dCallback = m_arrUIUpdateCallbacks[i];
if (dCallback != none)
dCallback();
}
Most of this can be condensed down to using a foreach loop or a for loop without having to copy the delegate object.
foreach might be recommended because there's reason to believe that it can quickly process more iterations compared to for since we can forfeit the iterator:
https://forums.epicgames.com/udk/udk-development/udk-programming-and-unrealscript/267770-foreach-arrayvariable-vs-for-i-0-i-array-length-i?p=3063653#post3063653
So, using a foreach without an index would look like this:
local delegate< UpdateCallback > dCallback;
foreach m_arrUIUpdateCallbacks(dCallback)
{
dCallback();
}
However, it's pretty much just conjecture. There's no telling if this will improve performance or not without some profiling.
There is room for optimization in
UIUpdate(). This function executes any time a new screen pops in the stack, is called by the tactical controller events (event ForceUIUpdate()andevent PreRender(), and during the pre-render phase.What
UIUpdate()does is execute any delegates that were enlisted per tick, so UI elements such as arrows pointing on a units head, Flag manager, watching for Fullscreen changes, etc. all rely on continuous execution for its logicAt best, while the game is idle, UIUpdate() wouldn't be much of an issue, but worst case it can tank the FPS quite a bit while the delegates are processing:

Aggregate for 10 seconds of gameplay (no loading between

GameReplicationInfo)UIUpdate()/PreRender() can be pretty intense during normal gameplay for lower end processors.
The current code for reference:
Most of this can be condensed down to using a foreach loop or a for loop without having to copy the delegate object.
foreachmight be recommended because there's reason to believe that it can quickly process more iterations compared toforsince we can forfeit the iterator:https://forums.epicgames.com/udk/udk-development/udk-programming-and-unrealscript/267770-foreach-arrayvariable-vs-for-i-0-i-array-length-i?p=3063653#post3063653
So, using a
foreachwithout an index would look like this:However, it's pretty much just conjecture. There's no telling if this will improve performance or not without some profiling.