mirror of
https://github.com/claunia/plist-cil.git
synced 2025-12-16 11:04:26 +00:00
General refactor and clean-up.
This commit is contained in:
@@ -2,22 +2,22 @@
|
||||
using BenchmarkDotNet.Attributes;
|
||||
using BenchmarkDotNet.Jobs;
|
||||
|
||||
namespace Claunia.PropertyList.Benchmark
|
||||
namespace Claunia.PropertyList.Benchmark;
|
||||
|
||||
[SimpleJob(RuntimeMoniker.NetCoreApp50)]
|
||||
[MemoryDiagnoser]
|
||||
public class BinaryPropertyListParserBenchmarks
|
||||
{
|
||||
[SimpleJob(RuntimeMoniker.NetCoreApp50), MemoryDiagnoser]
|
||||
public class BinaryPropertyListParserBenchmarks
|
||||
byte[] data;
|
||||
|
||||
[GlobalSetup]
|
||||
public void Setup() => data = File.ReadAllBytes("plist.bin");
|
||||
|
||||
[Benchmark]
|
||||
public NSObject ReadLargePropertylistTest()
|
||||
{
|
||||
byte[] data;
|
||||
NSObject nsObject = PropertyListParser.Parse(data);
|
||||
|
||||
[GlobalSetup]
|
||||
public void Setup() => data = File.ReadAllBytes("plist.bin");
|
||||
|
||||
[Benchmark]
|
||||
public NSObject ReadLargePropertylistTest()
|
||||
{
|
||||
NSObject nsObject = PropertyListParser.Parse(data);
|
||||
|
||||
return nsObject;
|
||||
}
|
||||
return nsObject;
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,17 @@
|
||||
using BenchmarkDotNet.Attributes;
|
||||
using BenchmarkDotNet.Jobs;
|
||||
|
||||
namespace Claunia.PropertyList.Benchmark
|
||||
namespace Claunia.PropertyList.Benchmark;
|
||||
|
||||
[SimpleJob(RuntimeMoniker.NetCoreApp50)]
|
||||
[MemoryDiagnoser]
|
||||
public class BinaryPropertyListWriterBenchmarks
|
||||
{
|
||||
[SimpleJob(RuntimeMoniker.NetCoreApp50), MemoryDiagnoser]
|
||||
public class BinaryPropertyListWriterBenchmarks
|
||||
{
|
||||
NSObject data;
|
||||
NSObject data;
|
||||
|
||||
[GlobalSetup]
|
||||
public void Setup() => data = PropertyListParser.Parse("plist.bin");
|
||||
[GlobalSetup]
|
||||
public void Setup() => data = PropertyListParser.Parse("plist.bin");
|
||||
|
||||
[Benchmark]
|
||||
public byte[] WriteLargePropertylistTest() => BinaryPropertyListWriter.WriteToArray(data);
|
||||
}
|
||||
[Benchmark]
|
||||
public byte[] WriteLargePropertylistTest() => BinaryPropertyListWriter.WriteToArray(data);
|
||||
}
|
||||
@@ -1,13 +1,12 @@
|
||||
using BenchmarkDotNet.Running;
|
||||
|
||||
namespace Claunia.PropertyList.Benchmark
|
||||
namespace Claunia.PropertyList.Benchmark;
|
||||
|
||||
internal class Program
|
||||
{
|
||||
internal class Program
|
||||
static void Main(string[] args)
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
BenchmarkRunner.Run<BinaryPropertyListParserBenchmarks>();
|
||||
BenchmarkRunner.Run<BinaryPropertyListWriterBenchmarks>();
|
||||
}
|
||||
BenchmarkRunner.Run<BinaryPropertyListParserBenchmarks>();
|
||||
BenchmarkRunner.Run<BinaryPropertyListWriterBenchmarks>();
|
||||
}
|
||||
}
|
||||
@@ -7,11 +7,11 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="BenchmarkDotNet" Version="0.15.2" />
|
||||
<PackageReference Include="BenchmarkDotNet" Version="0.15.2"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\plist-cil\plist-cil.csproj" />
|
||||
<ProjectReference Include="..\plist-cil\plist-cil.csproj"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user