Add more perf measurements

This commit is contained in:
Pavlos Touboulidis
2014-04-23 03:43:46 +03:00
parent c44d73d581
commit 2d8cd8299f
3 changed files with 15 additions and 6 deletions

View File

@@ -251,8 +251,11 @@ namespace OpenRA
{ {
map = modData.PrepareMap(mapUID); map = modData.PrepareMap(mapUID);
} }
using (new PerfTimer("NewWorld"))
{
orderManager.world = new World(modData.Manifest, map, orderManager, isShellmap); orderManager.world = new World(modData.Manifest, map, orderManager, isShellmap);
orderManager.world.Timestep = Timestep; orderManager.world.Timestep = Timestep;
}
worldRenderer = new WorldRenderer(orderManager.world); worldRenderer = new WorldRenderer(orderManager.world);
using (new PerfTimer("LoadComplete")) using (new PerfTimer("LoadComplete"))
{ {

View File

@@ -46,11 +46,14 @@ namespace OpenRA
foreach (var path in paths) foreach (var path in paths)
{ {
try try
{
using (new Support.PerfTimer(path))
{ {
var map = new Map(path, manifest.Mod.Id); var map = new Map(path, manifest.Mod.Id);
if (manifest.MapCompatibility.Contains(map.RequiresMod)) if (manifest.MapCompatibility.Contains(map.RequiresMod))
previews[map.Uid].UpdateFromMap(map); previews[map.Uid].UpdateFromMap(map);
} }
}
catch (Exception e) catch (Exception e)
{ {
Console.WriteLine("Failed to load map: {0}", path); Console.WriteLine("Failed to load map: {0}", path);

View File

@@ -148,8 +148,11 @@ namespace OpenRA
public void LoadComplete(WorldRenderer wr) public void LoadComplete(WorldRenderer wr)
{ {
foreach (var wlh in WorldActor.TraitsImplementing<IWorldLoaded>()) foreach (var wlh in WorldActor.TraitsImplementing<IWorldLoaded>())
{
using (new Support.PerfTimer(wlh.GetType().Name + ".WorldLoaded"))
wlh.WorldLoaded(this, wr); wlh.WorldLoaded(this, wr);
} }
}
public Actor CreateActor(string name, TypeDictionary initDict) public Actor CreateActor(string name, TypeDictionary initDict)
{ {