2018-07-09 19:57:08 +01:00
|
|
|
|
using System.IO;
|
|
|
|
|
|
using BenchmarkDotNet.Attributes;
|
2018-06-19 11:16:14 +02:00
|
|
|
|
using BenchmarkDotNet.Attributes.Jobs;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Claunia.PropertyList.Benchmark
|
|
|
|
|
|
{
|
|
|
|
|
|
[CoreJob]
|
|
|
|
|
|
[MemoryDiagnoser]
|
|
|
|
|
|
public class BinaryPropertyListParserBenchmarks
|
|
|
|
|
|
{
|
2018-07-09 19:57:08 +01:00
|
|
|
|
byte[] data;
|
2018-06-19 11:16:14 +02:00
|
|
|
|
|
|
|
|
|
|
[GlobalSetup]
|
|
|
|
|
|
public void Setup()
|
|
|
|
|
|
{
|
|
|
|
|
|
data = File.ReadAllBytes("plist.bin");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Benchmark]
|
|
|
|
|
|
public NSObject ReadLargePropertylistTest()
|
|
|
|
|
|
{
|
2018-07-09 19:57:08 +01:00
|
|
|
|
NSObject nsObject = PropertyListParser.Parse(data);
|
2018-06-19 11:16:14 +02:00
|
|
|
|
return nsObject;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2018-07-09 19:57:08 +01:00
|
|
|
|
}
|