Replace IRemoveFrozenActor with FrozenActorLayer.Remove.

The IRemoveFrozenActor interface is replaced with a Remove method on FrozenActorLayer. IRemoveFrozenActor is a performance problem for FrozenActorLayer.Tick as it incurs a large cache miss penalty in order to load and enumerate the array of these interfaces for every frozen actor. Instead, we invert control and allow traits to remove frozen actors directly which eliminates the performance penalty.
This commit is contained in:
RoosterDragon
2015-12-31 01:42:19 +00:00
parent c98df23b57
commit a232eff7fd
5 changed files with 12 additions and 86 deletions

View File

@@ -388,11 +388,6 @@ namespace OpenRA.Traits
void DoImpact(Target target, Actor firedBy, IEnumerable<int> damageModifiers);
}
public interface IRemoveFrozenActor
{
bool RemoveActor(Actor self, Player owner);
}
public interface IRulesetLoaded<TInfo> { void RulesetLoaded(Ruleset rules, TInfo info); }
public interface IRulesetLoaded : IRulesetLoaded<ActorInfo>, ITraitInfoInterface { }
}