From 2348db097b47ccaa4fe235e538c0016195103f00 Mon Sep 17 00:00:00 2001 From: "SmallChi(Koike)" <564952747@qq.com> Date: Tue, 19 Nov 2024 16:20:35 +0800 Subject: [PATCH] =?UTF-8?q?v2.2.6=201.=E5=8D=87=E7=BA=A7net9=202.=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E8=A7=A3=E6=9E=90=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dotnetcore.yml | 2 +- README.md | 29 +++++++++---------- global.json | 2 +- src/Info.props | 4 +-- .../JT809.Protocol.Benchmark.csproj | 4 +-- .../JT809SerializerContext.cs | 2 +- ...809.Protocol.Extensions.JT1078.Test.csproj | 10 +++---- .../JT809.Protocol.Test.csproj | 4 +-- .../JT809_0x1200_0x1202Test.cs | 2 +- src/JT809.Protocol.Test/Simples/Demo5.cs | 2 +- src/JT809.Protocol/JT809.Protocol.csproj | 20 ++++++------- 11 files changed, 40 insertions(+), 41 deletions(-) diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index bf580f0..42ca192 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -12,7 +12,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@master with: - dotnet-version: 8.0.300 + dotnet-version: 9.0.100 - name: dotnet info run: dotnet --info - name: dotnet restore diff --git a/README.md b/README.md index 2608f80..11565ae 100644 --- a/README.md +++ b/README.md @@ -299,26 +299,25 @@ public class JT809_2019_Config : JT809GlobalConfigBase ## 使用BenchmarkDotNet性能测试报告(只是玩玩,不能当真) -``` ini +```ini -BenchmarkDotNet v0.13.10, Windows 11 (10.0.22621.2715/22H2/2022Update/SunValley2) +BenchmarkDotNet v0.14.0, Windows 11 (10.0.22631.4460/23H2/2023Update/SunValley3) Intel Core i7-8700K CPU 3.70GHz (Coffee Lake), 1 CPU, 12 logical and 6 physical cores -.NET SDK 8.0.100 - [Host] : .NET 8.0.0 (8.0.23.53103), X64 RyuJIT AVX2 - Job-VUTFXE : .NET 8.0.0 (8.0.23.53103), X64 RyuJIT AVX2 +.NET SDK 9.0.100 + [Host] : .NET 9.0.0 (9.0.24.52809), X64 RyuJIT AVX2 + Job-IFEFGZ : .NET 9.0.0 (9.0.24.52809), X64 RyuJIT AVX2 -Platform=AnyCpu Server=False Toolchain=.NET 8.0 +Platform=AnyCpu Server=False Toolchain=.NET 9.0 ``` - -| Method | N | Mean | Error | StdDev | Gen0 | Allocated | -|---------------------------------------- |------- |-------------:|------------:|----------:|-----------:|-------------:| -| **JT809_0x9400_0x9401_Package_Deserialize** | **100** | **293.3 μs** | **2.50 μs** | **2.21 μs** | **16.6016** | **103.13 KB** | -| JT809_0x9400_0x9401_Package_Serialize | 100 | 149.4 μs | 1.02 μs | 0.95 μs | 14.6484 | 90.63 KB | -| **JT809_0x9400_0x9401_Package_Deserialize** | **10000** | **28,493.1 μs** | **164.55 μs** | **153.92 μs** | **1656.2500** | **10312.52 KB** | -| JT809_0x9400_0x9401_Package_Serialize | 10000 | 15,197.7 μs | 65.31 μs | 57.89 μs | 1468.7500 | 9062.51 KB | -| **JT809_0x9400_0x9401_Package_Deserialize** | **100000** | **283,419.7 μs** | **1,039.42 μs** | **972.27 μs** | **16500.0000** | **103125.36 KB** | -| JT809_0x9400_0x9401_Package_Serialize | 100000 | 150,152.6 μs | 589.37 μs | 551.30 μs | 14750.0000 | 90625.18 KB | +| Method | N | Mean | Error | StdDev | Gen0 | Allocated | +|---------------------------------------- |------- |-------------:|------------:|------------:|-----------:|-------------:| +| **JT809_0x9400_0x9401_Package_Deserialize** | **100** | **363.7 μs** | **6.42 μs** | **6.00 μs** | **16.6016** | **103.13 KB** | +| JT809_0x9400_0x9401_Package_Serialize | 100 | 147.9 μs | 1.64 μs | 1.45 μs | 14.6484 | 90.63 KB | +| **JT809_0x9400_0x9401_Package_Deserialize** | **10000** | **35,620.3 μs** | **470.76 μs** | **440.35 μs** | **1642.8571** | **10312.58 KB** | +| JT809_0x9400_0x9401_Package_Serialize | 10000 | 14,931.2 μs | 217.72 μs | 203.65 μs | 1468.7500 | 9062.52 KB | +| **JT809_0x9400_0x9401_Package_Deserialize** | **100000** | **372,631.6 μs** | **7,066.99 μs** | **6,610.47 μs** | **16000.0000** | **103126.05 KB** | +| JT809_0x9400_0x9401_Package_Serialize | 100000 | 151,873.4 μs | 1,104.01 μs | 921.90 μs | 14750.0000 | 90625.26 KB | ## JT809协议消息对照表 diff --git a/global.json b/global.json index 7fa817c..20f482a 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "8.0.300" + "version": "9.0.100" } } \ No newline at end of file diff --git a/src/Info.props b/src/Info.props index 6048b74..c880dcf 100644 --- a/src/Info.props +++ b/src/Info.props @@ -1,6 +1,6 @@  - netstandard2.0;net7.0;net8.0; + netstandard2.0;net8.0;net9.0; latest Copyright 2018. SmallChi(Koike) @@ -8,7 +8,7 @@ https://github.com/SmallChi/JT809 https://github.com/SmallChi/JT809/blob/master/LICENSE https://github.com/SmallChi/JT809/blob/master/LICENSE - 2.2.5 + 2.2.6 LICENSE true latest diff --git a/src/JT809.Protocol.Benchmark/JT809.Protocol.Benchmark.csproj b/src/JT809.Protocol.Benchmark/JT809.Protocol.Benchmark.csproj index 674d5eb..61df2bb 100644 --- a/src/JT809.Protocol.Benchmark/JT809.Protocol.Benchmark.csproj +++ b/src/JT809.Protocol.Benchmark/JT809.Protocol.Benchmark.csproj @@ -2,11 +2,11 @@ Exe - net8.0 + net9.0 - + diff --git a/src/JT809.Protocol.Benchmark/JT809SerializerContext.cs b/src/JT809.Protocol.Benchmark/JT809SerializerContext.cs index 0d6e364..4d3da26 100644 --- a/src/JT809.Protocol.Benchmark/JT809SerializerContext.cs +++ b/src/JT809.Protocol.Benchmark/JT809SerializerContext.cs @@ -87,7 +87,7 @@ namespace JT809.Protocol.Benchmark { public JT809SerializerContextConfig() { - AddJob(Job.Default.WithGcServer(false).WithToolchain(CsProjCoreToolchain.NetCoreApp80).WithPlatform(Platform.AnyCpu)); + AddJob(Job.Default.WithGcServer(false).WithToolchain(CsProjCoreToolchain.NetCoreApp90).WithPlatform(Platform.AnyCpu)); } } } diff --git a/src/JT809.Protocol.Extensions/JT809.Protocol.Extensions.JT1078.Test/JT809.Protocol.Extensions.JT1078.Test.csproj b/src/JT809.Protocol.Extensions/JT809.Protocol.Extensions.JT1078.Test/JT809.Protocol.Extensions.JT1078.Test.csproj index e154332..06420df 100644 --- a/src/JT809.Protocol.Extensions/JT809.Protocol.Extensions.JT1078.Test/JT809.Protocol.Extensions.JT1078.Test.csproj +++ b/src/JT809.Protocol.Extensions/JT809.Protocol.Extensions.JT1078.Test/JT809.Protocol.Extensions.JT1078.Test.csproj @@ -1,14 +1,14 @@  - net8.0 + net9.0 - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/JT809.Protocol.Test/JT809.Protocol.Test.csproj b/src/JT809.Protocol.Test/JT809.Protocol.Test.csproj index 7ac1a86..85ba6d3 100644 --- a/src/JT809.Protocol.Test/JT809.Protocol.Test.csproj +++ b/src/JT809.Protocol.Test/JT809.Protocol.Test.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 false 1701;1702;1591 @@ -11,7 +11,7 @@ - + diff --git a/src/JT809.Protocol.Test/JT809SubMessageBody/JT809_0x1200_0x1202Test.cs b/src/JT809.Protocol.Test/JT809SubMessageBody/JT809_0x1200_0x1202Test.cs index 14620d1..3f85a18 100644 --- a/src/JT809.Protocol.Test/JT809SubMessageBody/JT809_0x1200_0x1202Test.cs +++ b/src/JT809.Protocol.Test/JT809SubMessageBody/JT809_0x1200_0x1202Test.cs @@ -190,7 +190,7 @@ namespace JT809.Protocol.Test.JT809SubMessageBody Assert.Equal(132444444, jt808_0x0200.Lng); Assert.Equal(60, jt808_0x0200.Speed); Assert.Equal((uint)2, jt808_0x0200.StatusFlag); - Assert.Equal(100, ((JT808_0x0200_0x01)jt808_0x0200.BasicLocationAttachData[JT808Constants.JT808_0x0200_0x01]).Mileage); + Assert.Equal(100u, ((JT808_0x0200_0x01)jt808_0x0200.BasicLocationAttachData[JT808Constants.JT808_0x0200_0x01]).Mileage); Assert.Equal(55, ((JT808_0x0200_0x02)jt808_0x0200.BasicLocationAttachData[JT808Constants.JT808_0x0200_0x02]).Oil); } diff --git a/src/JT809.Protocol.Test/Simples/Demo5.cs b/src/JT809.Protocol.Test/Simples/Demo5.cs index e5be49f..6575b3b 100644 --- a/src/JT809.Protocol.Test/Simples/Demo5.cs +++ b/src/JT809.Protocol.Test/Simples/Demo5.cs @@ -199,7 +199,7 @@ namespace JT809.Protocol.Test.Simples Assert.Equal(132444444, jt808_0x0200.Lng); Assert.Equal(60, jt808_0x0200.Speed); Assert.Equal((uint)2, jt808_0x0200.StatusFlag); - Assert.Equal(100, ((JT808_0x0200_0x01)jt808_0x0200.BasicLocationAttachData[JT808Constants.JT808_0x0200_0x01]).Mileage); + Assert.Equal(100u, ((JT808_0x0200_0x01)jt808_0x0200.BasicLocationAttachData[JT808Constants.JT808_0x0200_0x01]).Mileage); Assert.Equal(55, ((JT808_0x0200_0x02)jt808_0x0200.BasicLocationAttachData[JT808Constants.JT808_0x0200_0x02]).Oil); } diff --git a/src/JT809.Protocol/JT809.Protocol.csproj b/src/JT809.Protocol/JT809.Protocol.csproj index 2a4d65a..ebadba5 100644 --- a/src/JT809.Protocol/JT809.Protocol.csproj +++ b/src/JT809.Protocol/JT809.Protocol.csproj @@ -82,25 +82,25 @@ - + - + - - - + + + - - - - - + + + + + True