Show More
Commit Description:
Add timers for Simulation and various engines...
Commit Description:
Add timers for Simulation and various engines
Starting to add additional timers for different stages of the process of
updating in order to get more insight into what is slowing it down.
The update takes 9ms, which is much longer than it used to.
Engine-specific timers are coming later.
References:
File last commit:
Show/Diff file:
Action:
scripts/LoadYaml.csx
53 lines | 1.5 KiB | text/plain | TextLexer
53 lines | 1.5 KiB | text/plain | TextLexer
r415 | #r "YamlDotNet.dll" | |||
r442 | #load "Shared.csx" | |||
r415 | ||||
using YamlDotNet.Serialization; | ||||
r442 | using System.Linq; | |||
using System.Collections.Generic; | ||||
r415 | ||||
Console.WriteLine("Hello World"); | ||||
var sr = new StreamReader(@"isometric-park-fna/Content/news_items.yaml"); | ||||
var input = new StringReader(sr.ReadToEnd()); | ||||
var deserializer = new DeserializerBuilder() | ||||
.Build(); | ||||
var items = deserializer.Deserialize<List<NewsItem>>(input); | ||||
Console.WriteLine("news_items.yaml loaded."); | ||||
sr = new StreamReader(@"isometric-park-fna/Content/news_items_pregenerated.yaml"); | ||||
input = new StringReader(sr.ReadToEnd()); | ||||
deserializer = new DeserializerBuilder() | ||||
.Build(); | ||||
items = deserializer.Deserialize<List<NewsItem>>(input); | ||||
Console.WriteLine("news_items_pregenerated.yaml loaded."); | ||||
r442 | ||||
var image_meta = LoadImageMeta(); | ||||
var images = new HashSet<String>(Directory.GetFiles("isometric-park-fna/Content/Portraits/")); | ||||
if (images.Count() != image_meta.Count()) { | ||||
Console.WriteLine(String.Format("Image metadata ({0}) doesn't match images ({1})", image_meta.Count(), images.Count())); | ||||
Console.WriteLine("Missing Images:"); | ||||
var image_meta_names = image_meta.Select((item) => "isometric-park-fna/Content/Portraits/" + item.Filename); | ||||
var missing_images = images.Except(image_meta_names); | ||||
foreach (String name in missing_images) | ||||
{ | ||||
Console.WriteLine(name); | ||||
} | ||||
System.Environment.Exit(1); | ||||
} | ||||
Console.WriteLine(String.Format("Items ({0}) portraits.yaml loaded.", image_meta.Count())); | ||||