From c6809c6aa3bf8f7087aec49f3a587fc7503115e7 Mon Sep 17 00:00:00 2001 From: Frederik Carlier Date: Wed, 20 Jun 2018 14:37:33 +0200 Subject: [PATCH] Add benchmark for writing binary property lists --- .../BinaryPropertyListWriterBenchmarks.cs | 25 +++++++++++++++++++ plist-cil.benchmark/Program.cs | 1 + 2 files changed, 26 insertions(+) create mode 100644 plist-cil.benchmark/BinaryPropertyListWriterBenchmarks.cs diff --git a/plist-cil.benchmark/BinaryPropertyListWriterBenchmarks.cs b/plist-cil.benchmark/BinaryPropertyListWriterBenchmarks.cs new file mode 100644 index 0000000..a461b12 --- /dev/null +++ b/plist-cil.benchmark/BinaryPropertyListWriterBenchmarks.cs @@ -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); + } + } +} diff --git a/plist-cil.benchmark/Program.cs b/plist-cil.benchmark/Program.cs index 77e5397..040c0ee 100644 --- a/plist-cil.benchmark/Program.cs +++ b/plist-cil.benchmark/Program.cs @@ -8,6 +8,7 @@ namespace Claunia.PropertyList.Benchmark static void Main(string[] args) { var summary = BenchmarkRunner.Run(); + summary = BenchmarkRunner.Run(); } } }