Sfoglia il codice sorgente

v2.3.0

升级net5
Update dotnetcore.yml
tags/v2.3.0
SmallChi(Koike) 4 anni fa
parent
commit
6f56c88b69
7 ha cambiato i file con 49 aggiunte e 56 eliminazioni
  1. +1
    -1
      .github/workflows/dotnetcore.yml
  2. +19
    -19
      README.md
  3. +1
    -1
      src/JT808.Protocol.Benchmark/JT808.Protocol.Benchmark.csproj
  4. +1
    -1
      src/JT808.Protocol.Benchmark/JT808SerializerContext.cs
  5. +5
    -5
      src/JT808.Protocol.Test/JT808.Protocol.Test.csproj
  6. +1
    -1
      src/JT808.Protocol/Extensions/JT808HexExtensions.cs
  7. +21
    -28
      src/JT808.Protocol/JT808.Protocol.csproj

+ 1
- 1
.github/workflows/dotnetcore.yml Vedi File

@@ -12,7 +12,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@master
with:
dotnet-version: 3.1.403
dotnet-version: 5.0.100
- name: dotnet info
run: dotnet --info
- name: dotnet restore


+ 19
- 19
README.md Vedi File

@@ -302,28 +302,28 @@ JT808Serializer DT2JT808Serializer = new JT808Serializer(DT2JT808Config);

BenchmarkDotNet=v0.12.1, OS=Windows 10.0.19041.572 (2004/?/20H1)
Intel Core i7-8700K CPU 3.70GHz (Coffee Lake), 1 CPU, 12 logical and 6 physical cores
.NET Core SDK=3.1.403
[Host] : .NET Core 3.1.9 (CoreCLR 4.700.20.47201, CoreFX 4.700.20.47203), X64 RyuJIT
Job-ZFMIVI : .NET Core 3.1.9 (CoreCLR 4.700.20.47201, CoreFX 4.700.20.47203), X64 RyuJIT
.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

Platform=AnyCpu Server=False Toolchain=.NET Core 3.1
Platform=AnyCpu Server=False Toolchain=.NET Core 5.0

```
| Method | Categories | N | Mean | Error | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|-------------------------------- |----------------- |------- |--------------:|-------------:|-------------:|-----------:|------:|------:|-------------:|
| **0x0200_All_AttachId_Serialize** | **0x0200Serializer** | **100** | **277.49 μs** | **2.517 μs** | **2.355 μs** | **31.7383** | **-** | **-** | **196.1 KB** |
| 0x0200_All_AttachId_Deserialize | 0x0200Serializer | 100 | 829.22 μs | 9.635 μs | 9.012 μs | 80.0781 | - | - | 493.75 KB |
| **0x0200_All_AttachId_Serialize** | **0x0200Serializer** | **10000** | **26,984.85 μs** | **231.925 μs** | **216.943 μs** | **3187.5000** | **-** | **-** | **19609.38 KB** |
| 0x0200_All_AttachId_Deserialize | 0x0200Serializer | 10000 | 82,945.39 μs | 514.580 μs | 456.162 μs | 8000.0000 | - | - | 49375.21 KB |
| **0x0200_All_AttachId_Serialize** | **0x0200Serializer** | **100000** | **270,868.40 μs** | **2,424.798 μs** | **2,268.158 μs** | **32000.0000** | **-** | **-** | **196093.75 KB** |
| 0x0200_All_AttachId_Deserialize | 0x0200Serializer | 100000 | 820,168.63 μs | 7,354.224 μs | 6,879.145 μs | 80000.0000 | - | - | 493750 KB |
| | | | | | | | | | |
| **0x0100Serialize** | **0x0100Serializer** | **100** | **86.25 μs** | **1.057 μs** | **0.825 μs** | **10.7422** | **-** | **-** | **66.41 KB** |
| 0x0100Deserialize | 0x0100Serializer | 100 | 79.51 μs | 0.849 μs | 0.753 μs | 15.7471 | - | - | 96.88 KB |
| **0x0100Serialize** | **0x0100Serializer** | **10000** | **8,955.07 μs** | **99.754 μs** | **93.310 μs** | **1078.1250** | **-** | **-** | **6640.71 KB** |
| 0x0100Deserialize | 0x0100Serializer | 10000 | 7,844.03 μs | 90.418 μs | 75.503 μs | 1578.1250 | - | - | 9687.58 KB |
| **0x0100Serialize** | **0x0100Serializer** | **100000** | **90,456.92 μs** | **1,200.062 μs** | **1,122.539 μs** | **10833.3333** | **-** | **-** | **66407.72 KB** |
| 0x0100Deserialize | 0x0100Serializer | 100000 | 80,086.99 μs | 1,110.513 μs | 984.441 μs | 15714.2857 | - | - | 96875 KB |
| 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 |

## JT808终端通讯协议消息对照表



+ 1
- 1
src/JT808.Protocol.Benchmark/JT808.Protocol.Benchmark.csproj Vedi File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PlatformTarget>AnyCPU</PlatformTarget>
<OutputType>Exe</OutputType>


+ 1
- 1
src/JT808.Protocol.Benchmark/JT808SerializerContext.cs Vedi File

@@ -164,7 +164,7 @@ namespace JT808.Protocol.Benchmark
{
public JT808SerializerConfig()
{
Add(Job.Default.WithGcServer(false).With(CsProjCoreToolchain.NetCoreApp31).With(Platform.AnyCpu));
AddJob(Job.Default.WithGcServer(false).WithToolchain(CsProjCoreToolchain.NetCoreApp50).WithPlatform(Platform.AnyCpu));
}
}
}

+ 5
- 5
src/JT808.Protocol.Test/JT808.Protocol.Test.csproj Vedi File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5</TargetFramework>
<IsPackable>false</IsPackable>
<LangVersion>8.0</LangVersion>
</PropertyGroup>
@@ -107,15 +107,15 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.0">
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.0" />
<PackageReference Include="NETStandard.Library" Version="2.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="System.Drawing.Common" Version="4.7.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.9" />
<PackageReference Include="System.Drawing.Common" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.0" />
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.console" Version="2.4.1">


+ 1
- 1
src/JT808.Protocol/Extensions/JT808HexExtensions.cs Vedi File

@@ -65,7 +65,7 @@ namespace JT808.Protocol.Extensions

public static string ReadHexStringLittle(ReadOnlySpan<byte> read, ref int offset, int len)
{
ReadOnlySpan<byte> source = read.Slice(offset, len);
//ReadOnlySpan<byte> source = read.Slice(offset, len);
string hex = HexUtil.DoHexDump(read, offset, len);
offset += len;
return hex;


+ 21
- 28
src/JT808.Protocol/JT808.Protocol.csproj Vedi File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;</TargetFrameworks>
<LangVersion>8.0</LangVersion>
<TargetFrameworks>netstandard2.0;netstandard2.1;net5;</TargetFrameworks>
<LangVersion>9.0</LangVersion>
<Copyright>Copyright 2018.</Copyright>
<Authors>SmallChi</Authors>
<PackageId>JT808</PackageId>
@@ -13,27 +13,12 @@
<PackageProjectUrl>https://github.com/SmallChi/JT808</PackageProjectUrl>
<licenseUrl>https://github.com/SmallChi/JT808/blob/master/LICENSE</licenseUrl>
<license>https://github.com/SmallChi/JT808/blob/master/LICENSE</license>
<DocumentationFile>JT808.Protocol.xml</DocumentationFile>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<Version>2.2.14</Version>
<Version>2.3.0</Version>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>$(OutputPath)$(MSBuildProjectName).xml</DocumentationFile>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|Release|netstandard2.0|AnyCPU'">
<DocumentationFile>$(OutputPath)$(MSBuildProjectName).xml</DocumentationFile>
<OutputPath />
<NoWarn>1701;1702;CS1591;CS1572;CS1573;CS1574;CS1570;</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|Release|netstandard2.1|AnyCPU'">
<DocumentationFile>$(OutputPath)$(MSBuildProjectName).xml</DocumentationFile>
<OutputPath />
<NoWarn>1701;1702;CS1591;CS1572;CS1573;CS1574;CS1570;</NoWarn>
</PropertyGroup>

<ItemGroup>
<Compile Remove="Formatters\MessageBodyFormatters\**" />
<Compile Remove="Metadata\JT808LocationAttachProperties\**" />
@@ -67,30 +52,38 @@
<PackageReference Include="System.Dynamic.Runtime" Version="4.3.0" />
<PackageReference Include="System.Memory" Version="4.5.4" />
<PackageReference Include="System.Reflection.Extensions" Version="4.3.0" />
<PackageReference Include="System.Text.Json" Version="5.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.1' ">
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="System.Text.Json" Version="5.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net5' ">

</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.0">
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.7.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.9" />
<PackageReference Include="System.Text.Json" Version="4.7.2" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="5.0.0" />
</ItemGroup>

<ItemGroup>
<None Update="Extensions\JT808PackageExtensionsTemplate.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>JT808PackageExtensionsTemplate.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
</ItemGroup>
<ItemGroup>
<Compile Update="Extensions\JT808PackageExtensionsTemplate.cs">
<DesignTime>True</DesignTime>


Caricamento…
Annulla
Salva