mirror of
https://github.com/claunia/plist-cil.git
synced 2025-12-16 19:14:26 +00:00
Add benchmark for writing binary property lists
This commit is contained in:
25
plist-cil.benchmark/BinaryPropertyListWriterBenchmarks.cs
Normal file
25
plist-cil.benchmark/BinaryPropertyListWriterBenchmarks.cs
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,6 +8,7 @@ namespace Claunia.PropertyList.Benchmark
|
|||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
var summary = BenchmarkRunner.Run<BinaryPropertyListParserBenchmarks>();
|
var summary = BenchmarkRunner.Run<BinaryPropertyListParserBenchmarks>();
|
||||||
|
summary = BenchmarkRunner.Run<BinaryPropertyListWriterBenchmarks>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user