General refactor and clean-up.

This commit is contained in:
2025-08-07 22:31:12 +01:00
parent 0683e2217b
commit 5f6bf00855
59 changed files with 6772 additions and 6828 deletions

View File

@@ -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;
}
}

View File

@@ -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);
}

View File

@@ -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>();
}
}

View File

@@ -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>