Cache property lookups for the object parsing
This commit is contained in:
@@ -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}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user