Page MenuHomeWildfire Games

Optimize the event broadcast
Needs ReviewPublic

Authored by nani on Feb 16 2020, 1:25 PM.



Currently when CGUIManager::SendEventToAll is called it sends the event recursively to all gui objects whether they have set a script handler for that event or not. This diff optimizes this so only those that have it set are called.

Profiling information: in my case, on average, I saw the gui tick time go down from 1.5 msec/frame to 0.6 msec/frame while in session, so about 2x the performance.

Should be easy to validate the code is correct as the changes are pretty simple.

The only possible concern could be that now the script handlers may not be called on the same order as there were called previously.

Test Plan

Apply patch, test all the GUI still works as before.

Diff Detail

rP 0 A.D. Public Repository
Lint OK
No Unit Test Coverage
Build Status
Buildable 11143
Build 19870: arc lint + arc unit

Event Timeline

nani created this revision.Feb 16 2020, 1:25 PM
Angen awarded a token.Feb 16 2020, 1:26 PM