From b84bcbf661687acb8ef6597b692dc8cdfd94dcc2 Mon Sep 17 00:00:00 2001 From: "SmallChi(Koike)" <564952747@qq.com> Date: Wed, 10 Nov 2021 00:56:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7net6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dotnetcore.yml | 2 +- README.md | 41 +++++++++---------- src/Info.props | 2 +- .../JT808.Protocol.Benchmark.csproj | 6 +-- .../JT808SerializerContext.cs | 2 +- ...808.Protocol.Extensions.JT1078.Test.csproj | 8 ++-- ...808.Protocol.Extensions.SuBiao.Test.csproj | 6 +-- ...08.Protocol.Extensions.YueBiao.Test.csproj | 8 ++-- .../JT808.Protocol.Test.csproj | 10 ++--- src/JT808.Protocol/JT808.Protocol.csproj | 23 +++++++---- 10 files changed, 58 insertions(+), 50 deletions(-) diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index 7fff783..6adf8b3 100755 --- 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: 5.0.100 + dotnet-version: 6.0.100 - name: dotnet info run: dotnet --info - name: dotnet restore diff --git a/README.md b/README.md index 188174f..49cea9b 100644 --- a/README.md +++ b/README.md @@ -361,31 +361,30 @@ JT808Serializer DT2JT808Serializer = new JT808Serializer(DT2JT808Config); ``` ini -BenchmarkDotNet=v0.12.1, OS=Windows 10.0.19041.572 (2004/?/20H1) +BenchmarkDotNet=v0.13.1, OS=Windows 10.0.22000 Intel Core i7-8700K CPU 3.70GHz (Coffee Lake), 1 CPU, 12 logical and 6 physical cores -.NET Core SDK=5.0.100 - [Host] : .NET Core 5.0.0 (CoreCLR 5.0.20.51904, CoreFX 5.0.20.51904), X64 RyuJIT - Job-WADLYX : .NET Core 5.0.0 (CoreCLR 5.0.20.51904, CoreFX 5.0.20.51904), X64 RyuJIT +.NET SDK=6.0.100 + [Host] : .NET 6.0.0 (6.0.21.52210), X64 RyuJIT + Job-EIZRXW : .NET 6.0.0 (6.0.21.52210), X64 RyuJIT -Platform=AnyCpu Server=False Toolchain=.NET Core 5.0 +Platform=AnyCpu Server=False Toolchain=.NET 6.0 ``` -| Method | Categories | N | Mean | Error | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated | -|-------------------------------- |----------------- |------- |--------------:|--------------:|-------------:|-----------:|------:|------:|-------------:| -| **0x0200_All_AttachId_Serialize** | **0x0200Serializer** | **100** | **249.02 μs** | **3.466 μs** | **2.894 μs** | **31.7383** | **-** | **-** | **196.88 KB** | -| 0x0200_All_AttachId_Deserialize | 0x0200Serializer | 100 | 762.07 μs | 14.713 μs | 15.743 μs | 80.0781 | - | - | 496.09 KB | -| **0x0200_All_AttachId_Serialize** | **0x0200Serializer** | **10000** | **24,541.76 μs** | **173.184 μs** | **161.996 μs** | **3187.5000** | **-** | **-** | **19687.5 KB** | -| 0x0200_All_AttachId_Deserialize | 0x0200Serializer | 10000 | 75,919.55 μs | 1,326.444 μs | 1,175.858 μs | 8000.0000 | - | - | 49609.55 KB | -| **0x0200_All_AttachId_Serialize** | **0x0200Serializer** | **100000** | **249,887.82 μs** | **4,966.928 μs** | **5,520.727 μs** | **32000.0000** | **-** | **-** | **196876.26 KB** | -| 0x0200_All_AttachId_Deserialize | 0x0200Serializer | 100000 | 734,062.09 μs | 10,270.434 μs | 9,104.472 μs | 80000.0000 | - | - | 496095 KB | -| | | | | | | | | | | -| **0x0100Serialize** | **0x0100Serializer** | **100** | **79.16 μs** | **0.906 μs** | **0.803 μs** | **10.7422** | **-** | **-** | **66.41 KB** | -| 0x0100Deserialize | 0x0100Serializer | 100 | 70.47 μs | 1.377 μs | 2.060 μs | 15.7471 | - | - | 96.88 KB | -| **0x0100Serialize** | **0x0100Serializer** | **10000** | **7,934.91 μs** | **121.485 μs** | **113.637 μs** | **1078.1250** | **-** | **-** | **6640.63 KB** | -| 0x0100Deserialize | 0x0100Serializer | 10000 | 7,077.60 μs | 139.419 μs | 165.969 μs | 1578.1250 | - | - | 9687.5 KB | -| **0x0100Serialize** | **0x0100Serializer** | **100000** | **80,403.44 μs** | **1,522.446 μs** | **1,563.440 μs** | **10714.2857** | **-** | **-** | **66406.25 KB** | -| 0x0100Deserialize | 0x0100Serializer | 100000 | 69,196.07 μs | 1,289.555 μs | 1,206.251 μs | 15666.6667 | - | - | 96875.13 KB | - +| Method | Categories | N | Mean | Error | StdDev | Gen 0 | Allocated | +|-------------------------------- |----------------- |------- |--------------:|-------------:|-------------:|-----------:|-----------:| +| **0x0200_All_AttachId_Serialize** | **0x0200Serializer** | **100** | **169.92 μs** | **2.059 μs** | **1.926 μs** | **29.5410** | **182 KB** | +| 0x0200_All_AttachId_Deserialize | 0x0200Serializer | 100 | 642.45 μs | 2.016 μs | 1.683 μs | 82.0313 | 508 KB | +| **0x0200_All_AttachId_Serialize** | **0x0200Serializer** | **10000** | **17,391.50 μs** | **346.644 μs** | **462.759 μs** | **2968.7500** | **18,203 KB** | +| 0x0200_All_AttachId_Deserialize | 0x0200Serializer | 10000 | 67,872.38 μs | 825.715 μs | 772.375 μs | 8250.0000 | 50,781 KB | +| **0x0200_All_AttachId_Serialize** | **0x0200Serializer** | **100000** | **174,867.56 μs** | **2,620.513 μs** | **2,451.229 μs** | **29000.0000** | **182,032 KB** | +| 0x0200_All_AttachId_Deserialize | 0x0200Serializer | 100000 | 676,860.84 μs | 8,716.108 μs | 7,726.603 μs | 82000.0000 | 507,813 KB | +| | | | | | | | | +| **0x0100Serialize** | **0x0100Serializer** | **100** | **72.60 μs** | **1.241 μs** | **1.161 μs** | **10.8643** | **67 KB** | +| 0x0100Deserialize | 0x0100Serializer | 100 | 64.80 μs | 0.767 μs | 0.641 μs | 15.8691 | 98 KB | +| **0x0100Serialize** | **0x0100Serializer** | **10000** | **7,602.54 μs** | **55.726 μs** | **52.126 μs** | **1093.7500** | **6,719 KB** | +| 0x0100Deserialize | 0x0100Serializer | 10000 | 6,567.71 μs | 53.112 μs | 44.351 μs | 1593.7500 | 9,766 KB | +| **0x0100Serialize** | **0x0100Serializer** | **100000** | **75,323.96 μs** | **494.762 μs** | **462.800 μs** | **10857.1429** | **67,189 KB** | +| 0x0100Deserialize | 0x0100Serializer | 100000 | 65,503.11 μs | 765.326 μs | 715.886 μs | 15875.0000 | 97,656 KB | ## JT808终端通讯协议消息对照表 diff --git a/src/Info.props b/src/Info.props index d0723f9..a885e0c 100644 --- a/src/Info.props +++ b/src/Info.props @@ -1,6 +1,6 @@  - netstandard2.0;netstandard2.1;net5.0; + netstandard2.0;netstandard2.1;net5.0;net6.0; 9.0 Copyright 2018. SmallChi(Koike) diff --git a/src/JT808.Protocol.Benchmark/JT808.Protocol.Benchmark.csproj b/src/JT808.Protocol.Benchmark/JT808.Protocol.Benchmark.csproj index e9dfa40..42fdbf9 100644 --- a/src/JT808.Protocol.Benchmark/JT808.Protocol.Benchmark.csproj +++ b/src/JT808.Protocol.Benchmark/JT808.Protocol.Benchmark.csproj @@ -1,7 +1,7 @@  - net5 + net6.0 true AnyCPU Exe @@ -14,8 +14,8 @@ - - + + diff --git a/src/JT808.Protocol.Benchmark/JT808SerializerContext.cs b/src/JT808.Protocol.Benchmark/JT808SerializerContext.cs index 12c3d85..22423cb 100644 --- a/src/JT808.Protocol.Benchmark/JT808SerializerContext.cs +++ b/src/JT808.Protocol.Benchmark/JT808SerializerContext.cs @@ -164,7 +164,7 @@ namespace JT808.Protocol.Benchmark { public JT808SerializerConfig() { - AddJob(Job.Default.WithGcServer(false).WithToolchain(CsProjCoreToolchain.NetCoreApp50).WithPlatform(Platform.AnyCpu)); + AddJob(Job.Default.WithGcServer(false).WithToolchain(CsProjCoreToolchain.NetCoreApp60).WithPlatform(Platform.AnyCpu)); } } } diff --git a/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.JT1078.Test/JT808.Protocol.Extensions.JT1078.Test.csproj b/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.JT1078.Test/JT808.Protocol.Extensions.JT1078.Test.csproj index 445b395..b492c23 100644 --- a/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.JT1078.Test/JT808.Protocol.Extensions.JT1078.Test.csproj +++ b/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.JT1078.Test/JT808.Protocol.Extensions.JT1078.Test.csproj @@ -1,13 +1,13 @@  - net5.0 + net6.0 - - - + + + all diff --git a/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.SuBiao.Test/JT808.Protocol.Extensions.SuBiao.Test.csproj b/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.SuBiao.Test/JT808.Protocol.Extensions.SuBiao.Test.csproj index e435dcb..e90beb2 100644 --- a/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.SuBiao.Test/JT808.Protocol.Extensions.SuBiao.Test.csproj +++ b/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.SuBiao.Test/JT808.Protocol.Extensions.SuBiao.Test.csproj @@ -1,14 +1,14 @@  - net5.0 + net6.0 false - - + + all diff --git a/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.YueBiao.Test/JT808.Protocol.Extensions.YueBiao.Test.csproj b/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.YueBiao.Test/JT808.Protocol.Extensions.YueBiao.Test.csproj index 57df50e..0adc375 100644 --- a/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.YueBiao.Test/JT808.Protocol.Extensions.YueBiao.Test.csproj +++ b/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.YueBiao.Test/JT808.Protocol.Extensions.YueBiao.Test.csproj @@ -1,20 +1,20 @@ - net5.0 + net6.0 false - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/JT808.Protocol.Test/JT808.Protocol.Test.csproj b/src/JT808.Protocol.Test/JT808.Protocol.Test.csproj index a16b623..27a360a 100644 --- a/src/JT808.Protocol.Test/JT808.Protocol.Test.csproj +++ b/src/JT808.Protocol.Test/JT808.Protocol.Test.csproj @@ -1,9 +1,9 @@  - net5.0 + net6.0 false - 9.0 + 10.0 @@ -108,11 +108,11 @@ - + - - + + diff --git a/src/JT808.Protocol/JT808.Protocol.csproj b/src/JT808.Protocol/JT808.Protocol.csproj index 3624384..b915488 100644 --- a/src/JT808.Protocol/JT808.Protocol.csproj +++ b/src/JT808.Protocol/JT808.Protocol.csproj @@ -32,7 +32,7 @@ - + @@ -56,21 +56,26 @@ - + + + - + + + - + + - - - + + + @@ -87,4 +92,8 @@ JT808PackageExtensionsTemplate.tt + + + +