Cache property lookups for the object parsing

This commit is contained in:
2016-04-27 11:16:54 -04:00
parent 9730600164
commit 790930dd66
10 changed files with 185 additions and 58 deletions
@@ -1,4 +1,6 @@
using LeafWeb.Core.Entities;
using System;
using System.Diagnostics;
using LeafWeb.Core.Entities;
using LeafWeb.Core.Parsers;
using LeafWeb.Core.Utility;
using NUnit.Framework;
@@ -21,5 +23,28 @@ namespace LeafWeb.Core.Tests.Parsers
Assert.That(leafGasComparisons.Length, Is.EqualTo(6));
}
//[Test, Explicit]
public void Parse_Timer()
{
var smallFileInfo = FileUtility.GetContentFile(ContentDirectory, "leafgascomparison.csv");
var largeFileInfo = FileUtility.GetContentFile(@"c:\temp\", "20160411095955C3_leafgascomparison.csv");
var timer = new Stopwatch();
timer.Start();
using (var parser = new LeafGasComparisonParser(smallFileInfo))
parser.Parse();
timer.Stop();
Console.WriteLine($"{timer.ElapsedMilliseconds}");
timer.Reset();
timer.Start();
using (var parser = new LeafGasComparisonParser(largeFileInfo))
parser.Parse();
timer.Stop();
Console.WriteLine($"{timer.ElapsedMilliseconds}");
}
}
}