OpenRA/OpenRA — pull request #5184 by pavlos256 (2014-04-23 09:17:56+00:00)
Title: Loading performance measurements

Write out-of-game performance measurements to perf.log.

Output sample:

```
[...]
StartGame
| PrepareMap
| | LoadRules: 519 ms
| | SequenceProvider.Initialize: 874 ms
| : 1517 ms
| NewWorld: 187 ms
| LoadComplete
| | LoadWidgetAtGameStart.WorldLoaded: 11 ms
| | ScreenMap.WorldLoaded: 0 ms
| | ScreenShaker.WorldLoaded: 0 ms
| | BridgeLayer.WorldLoaded: 5 ms
| | ShroudRenderer.WorldLoaded: 1 ms
| | DomainIndex.WorldLoaded: 121 ms
| | ResourceClaimLayer.WorldLoaded: 1 ms
| | ResourceType.WorldLoaded: 0 ms
| | ResourceLayer.WorldLoaded: 7 ms
| | ResourceType.WorldLoaded: 0 ms
| | SmudgeLayer.WorldLoaded: 3 ms
| | SmudgeLayer.WorldLoaded: 0 ms
| | PathfinderDebugOverlay.WorldLoaded: 0 ms
| | SpawnMapActors.WorldLoaded: 479 ms
| | LuaScriptInterface.WorldLoaded: 994 ms
| : 1623 ms
: 3382 ms
[...]
```

* Change the ambiguous Stopwatch.ElapsedTime() from a double to a TimeSpan
* Remove the unused Timer.cs and create PerfTimer for easy time measurements of code blocks
* Add several PerfTimer measurements
* Simple optimization on Map.ComputeHash()