[Patch] Speed up the Guard component
|Reported by:||wraitii||Owned by:||mimo|
|Priority:||Must Have||Milestone:||Alpha 22|
|Component:||UI & Simulation||Keywords:||patch|
The guard component is quite slow for no good reason. It uses OnGlobalOwnershipChanged, and since so many entities have a guard component, it becomes really slow when any ownership changed message gets sent.
I have changed it very slightly to not do that. Makes it go from a weird performance bottleneck to basically irrelevant, as it should be.
Putting as must have because it's actually a huge optimisation for the change.
Branch is here: https://github.com/wraitii/0ad/commits/guardRewrite . All changes in the one commit.