Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
- uses: actions/setup-dotnet@v6
with:
dotnet-version: |
8.x
9.x
10.x
- name: Derive CI package version
Expand All @@ -37,6 +38,8 @@ jobs:
run: ./eng/Validate-Package.ps1 -PackagePath ./artifacts/packages/OpenDisNet.${{ env.PACKAGE_VERSION }}.nupkg -ExpectedVersion ${{ env.PACKAGE_VERSION }}
- name: Restore packed-package consumer
run: dotnet restore tests/OpenDisNet.PackageSmoke/OpenDisNet.PackageSmoke.csproj --source "${{ github.workspace }}/artifacts/packages" --force --no-cache -p:OpenDisNetPackageVersion=${{ env.PACKAGE_VERSION }}
- name: Run packed-package consumer on .NET 8
run: dotnet run --project tests/OpenDisNet.PackageSmoke/OpenDisNet.PackageSmoke.csproj --configuration Release --framework net8.0 --no-restore -p:OpenDisNetPackageVersion=${{ env.PACKAGE_VERSION }}
- name: Run packed-package consumer on .NET 9
run: dotnet run --project tests/OpenDisNet.PackageSmoke/OpenDisNet.PackageSmoke.csproj --configuration Release --framework net9.0 --no-restore -p:OpenDisNetPackageVersion=${{ env.PACKAGE_VERSION }}
- name: Run packed-package consumer on .NET 10
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
- uses: actions/setup-dotnet@v6
with:
dotnet-version: |
8.x
9.x
10.x
- name: Verify tag commit is on main
Expand All @@ -37,6 +38,8 @@ jobs:
run: ./eng/Validate-Package.ps1 -PackagePath ./artifacts/packages/OpenDisNet.${{ env.PACKAGE_VERSION }}.nupkg -ExpectedVersion ${{ env.PACKAGE_VERSION }}
- name: Restore packed-package consumer
run: dotnet restore tests/OpenDisNet.PackageSmoke/OpenDisNet.PackageSmoke.csproj --source "${{ github.workspace }}/artifacts/packages" --force --no-cache -p:OpenDisNetPackageVersion=${{ env.PACKAGE_VERSION }}
- name: Run packed-package consumer on .NET 8
run: dotnet run --project tests/OpenDisNet.PackageSmoke/OpenDisNet.PackageSmoke.csproj --configuration Release --framework net8.0 --no-restore -p:OpenDisNetPackageVersion=${{ env.PACKAGE_VERSION }}
- name: Run packed-package consumer on .NET 9
run: dotnet run --project tests/OpenDisNet.PackageSmoke/OpenDisNet.PackageSmoke.csproj --configuration Release --framework net9.0 --no-restore -p:OpenDisNetPackageVersion=${{ env.PACKAGE_VERSION }}
- name: Run packed-package consumer on .NET 10
Expand Down
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ All notable changes are documented here. This project follows Semantic
Versioning starting with 1.0 and uses prerelease versions when conformance is
incomplete.

## 1.0.2 - Unreleased
## 1.1.0 - Unreleased

- Added first-class .NET 8 support alongside .NET 9 and .NET 10, including
full unit-test, package validation, and packed-package consumer coverage.
- Added BenchmarkDotNet coverage for representative Signal PDU parsing and
serialization paths, including caller-owned buffers and allocation reporting.

## 1.0.2 - 2026-07-23

- Ensured NuGet package, assembly, file, and informational versions agree for
release and CI builds, with package-level validation for both target frameworks.
Expand Down
3 changes: 3 additions & 0 deletions OpenDisNet.slnx
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<Solution>
<Folder Name="/benchmarks/">
<Project Path="benchmarks/OpenDisNet.Benchmarks/OpenDisNet.Benchmarks.csproj" />
</Folder>
<Folder Name="/samples/">
<Project Path="samples/OpenDisNet.PacketInspector/OpenDisNet.PacketInspector.csproj" />
</Folder>
Expand Down
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ dotnet test --configuration Release
dotnet pack src/OpenDisNet/OpenDisNet.csproj --configuration Release
```

The library targets .NET 9 and .NET 10 and uses nullable annotations,
The library targets .NET 8, .NET 9, and .NET 10 and uses nullable annotations,
deterministic builds, and symbol packages.

The implementation is reviewable in ordinary source files: PDU classes are
Expand All @@ -132,6 +132,19 @@ all 72 binary dispatch paths are in
and checked big-endian primitives are under
[`src/OpenDisNet/Binary`](src/OpenDisNet/Binary).

## Benchmarks

The BenchmarkDotNet suite measures typed parsing, non-throwing parsing, allocated
serialization, and serialization into caller-owned storage for representative
Signal PDU payload sizes. Run it on any supported runtime:

```shell
dotnet run --project benchmarks/OpenDisNet.Benchmarks -c Release -f net10.0
```

Replace `net10.0` with `net8.0` or `net9.0` for runtime comparisons. Benchmark
artifacts are written beneath `BenchmarkDotNet.Artifacts` and are not committed.

## Security

Treat network datagrams as untrusted. See [`SECURITY.md`](SECURITY.md) for the
Expand Down
13 changes: 13 additions & 0 deletions benchmarks/OpenDisNet.Benchmarks/OpenDisNet.Benchmarks.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.15.8" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\OpenDisNet\OpenDisNet.csproj" />
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions benchmarks/OpenDisNet.Benchmarks/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
using BenchmarkDotNet.Running;
using OpenDisNet.Benchmarks;

BenchmarkSwitcher.FromAssembly(typeof(SignalPduCodecBenchmarks).Assembly).Run(args);
55 changes: 55 additions & 0 deletions benchmarks/OpenDisNet.Benchmarks/SignalPduCodecBenchmarks.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
using BenchmarkDotNet.Attributes;
using OpenDisNet.Enumerations;
using OpenDisNet.Pdus;

namespace OpenDisNet.Benchmarks;

[MemoryDiagnoser]
public class SignalPduCodecBenchmarks
{
private SignalPdu _signal = null!;
private byte[] _datagram = null!;
private byte[] _destination = null!;

[Params(32, 160, 1024)]
public int PayloadBytes { get; set; }

[GlobalSetup]
public void Setup()
{
byte[] payload = new byte[PayloadBytes];
for (int index = 0; index < payload.Length; index++)
payload[index] = unchecked((byte)(index * 31));

_signal = new SignalPdu
{
ExerciseId = 1,
Timestamp = 42,
Radio = new RadioId(new EntityId(1, 10, 42), 7),
EncodingScheme = SignalEncodingScheme.EncodedAudio(SignalEncodingType.Opus),
TdlType = SignalTdlType.Other,
SampleRate = 8_000,
SampleCount = checked((ushort)Math.Min(PayloadBytes, ushort.MaxValue)),
};
_signal.SetData(payload);

_datagram = DisSerializer.Serialize(_signal);
_destination = new byte[_datagram.Length];
}

[Benchmark(Baseline = true)]
public SignalPdu DeserializeTyped() =>
DisSerializer.Deserialize<SignalPdu>(_datagram);

[Benchmark]
public bool TryDeserializeTyped() =>
DisSerializer.TryDeserialize<SignalPdu>(_datagram, out _, out _);

[Benchmark]
public byte[] SerializeAllocated() =>
DisSerializer.Serialize(_signal);

[Benchmark]
public int SerializeCallerOwned() =>
DisSerializer.Serialize(_signal, _destination);
}
Loading
Loading