Changed logging in DoTimed/RunActivity to create less overhead.
- Refactored PerfTimer to use less memory. - Avoid using the PerfTimer in highly called methods DoTimed and RunActivity, instead tracking long ticks manually to reduce overhead and avoid memory allocations. - Added some helper methods in PerfTimer to output information when a tick takes too long. - Changed PerfTimer logging to output the time at the start of the line, and no longer truncate output per line. - Settings.LongTickThreshold changed from TimeSpan to float and renamed to LongTickThresholdMs.
This commit is contained in:
@@ -244,9 +244,9 @@ namespace OpenRA
|
||||
foreach (var a in actors)
|
||||
a.Tick();
|
||||
|
||||
ActorsWithTrait<ITick>().DoTimed(x => x.Trait.Tick(x.Actor), "Trait", Game.Settings.Debug.LongTickThreshold);
|
||||
ActorsWithTrait<ITick>().DoTimed(x => x.Trait.Tick(x.Actor), "Trait");
|
||||
|
||||
effects.DoTimed(e => e.Tick(this), "Effect", Game.Settings.Debug.LongTickThreshold);
|
||||
effects.DoTimed(e => e.Tick(this), "Effect");
|
||||
}
|
||||
|
||||
while (frameEndActions.Count != 0)
|
||||
|
||||
Reference in New Issue
Block a user