Add benchmark for writing binary property lists

This commit is contained in:
Frederik Carlier
2018-06-20 14:37:33 +02:00
parent e8112c76b1
commit c6809c6aa3
2 changed files with 26 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Attributes.Jobs;
namespace Claunia.PropertyList.Benchmark
{
[CoreJob]
[MemoryDiagnoser]
public class BinaryPropertyListWriterBenchmarks
{
private NSObject data = null;
[GlobalSetup]
public void Setup()
{
data = PropertyListParser.Parse("plist.bin");
}
[Benchmark]
public byte[] WriteLargePropertylistTest()
{
return BinaryPropertyListWriter.WriteToArray(data);
}
}
}

View File

@@ -8,6 +8,7 @@ namespace Claunia.PropertyList.Benchmark
static void Main(string[] args)
{
var summary = BenchmarkRunner.Run<BinaryPropertyListParserBenchmarks>();
summary = BenchmarkRunner.Run<BinaryPropertyListWriterBenchmarks>();
}
}
}