Skip to content

Commit

Permalink
v2.2.3
Browse files Browse the repository at this point in the history
添加net7.0支持
  • Loading branch information
SmallChi committed Nov 10, 2022
1 parent 152e9f6 commit 79acb7b
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@master
with:
dotnet-version: 6.0.400
dotnet-version: 7.0.100
- name: dotnet info
run: dotnet --info
- name: dotnet restore
Expand Down
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,23 +301,24 @@ public class JT809_2019_Config : JT809GlobalConfigBase

``` ini

BenchmarkDotNet=v0.13.1, OS=Windows 10.0.22000
BenchmarkDotNet=v0.13.2, OS=Windows 11 (10.0.22621.819)
Intel Core i7-8700K CPU 3.70GHz (Coffee Lake), 1 CPU, 12 logical and 6 physical cores
.NET SDK=6.0.101
[Host] : .NET 6.0.1 (6.0.121.56705), X64 RyuJIT
Job-GLUSZL : .NET 6.0.1 (6.0.121.56705), X64 RyuJIT
.NET SDK=7.0.100
[Host] : .NET 7.0.0 (7.0.22.51805), X64 RyuJIT AVX2
Job-WBHHQZ : .NET 7.0.0 (7.0.22.51805), X64 RyuJIT AVX2

Platform=AnyCpu Server=False Toolchain=.NET 6.0
Platform=AnyCpu Server=False Toolchain=.NET 7.0

```
| Method | N | Mean | Error | StdDev | Gen 0 | Allocated |
|---------------------------------------- |------- |-------------:|------------:|------------:|-----------:|-----------:|
| **JT809_0x9400_0x9401_Package_Deserialize** | **100** | **518.6 μs** | **4.07 μs** | **3.40 μs** | **16.6016** | **103 KB** |
| JT809_0x9400_0x9401_Package_Serialize | 100 | 182.1 μs | 1.60 μs | 1.34 μs | 14.6484 | 91 KB |
| **JT809_0x9400_0x9401_Package_Deserialize** | **10000** | **50,367.9 μs** | **477.53 μs** | **446.68 μs** | **1600.0000** | **10,313 KB** |
| JT809_0x9400_0x9401_Package_Serialize | 10000 | 18,303.2 μs | 176.25 μs | 164.87 μs | 1468.7500 | 9,063 KB |
| **JT809_0x9400_0x9401_Package_Deserialize** | **100000** | **502,960.6 μs** | **2,001.44 μs** | **1,774.22 μs** | **16000.0000** | **103,129 KB** |
| JT809_0x9400_0x9401_Package_Serialize | 100000 | 182,137.2 μs | 1,709.29 μs | 1,598.87 μs | 14000.0000 | 90,626 KB |

Method | N | Mean | Error | StdDev | Gen0 | Allocated |
---------------------------------------- |------- |-------------:|------------:|------------:|-----------:|------------:|
**JT809_0x9400_0x9401_Package_Deserialize** | **100** | **486.9 μs** | **9.46 μs** | **11.62 μs** | **16.6016** | **103.13 KB** |
JT809_0x9400_0x9401_Package_Serialize | 100 | 192.0 μs | 3.66 μs | 4.63 μs | 14.6484 | 90.63 KB |
**JT809_0x9400_0x9401_Package_Deserialize** | **10000** | **48,395.5 μs** | **823.85 μs** | **770.63 μs** | **1636.3636** | **10312.57 KB** |
JT809_0x9400_0x9401_Package_Serialize | 10000 | 19,033.4 μs | 279.80 μs | 248.04 μs | 1468.7500 | 9062.53 KB |
**JT809_0x9400_0x9401_Package_Deserialize** | **100000** | **492,172.8 μs** | **9,680.82 μs** | **9,507.86 μs** | **16000.0000** | **103125.8 KB** |
JT809_0x9400_0x9401_Package_Serialize | 100000 | 189,518.7 μs | 2,357.11 μs | 2,204.84 μs | 14666.6667 | 90625.27 KB |

## JT809协议消息对照表

Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "6.0.400"
"version": "7.0.100"
}
}
6 changes: 3 additions & 3 deletions src/Info.props
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project>
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<LangVersion>10.0</LangVersion>
<TargetFrameworks>net6.0;net7.0;</TargetFrameworks>
<LangVersion>11.0</LangVersion>
<Copyright>Copyright 2018.</Copyright>
<Authors>SmallChi(Koike)</Authors>
<RepositoryUrl>https://github.com/SmallChi/JT809</RepositoryUrl>
<PackageProjectUrl>https://github.com/SmallChi/JT809</PackageProjectUrl>
<license>https://github.com/SmallChi/JT809/blob/master/LICENSE</license>
<licenseUrl>https://github.com/SmallChi/JT809/blob/master/LICENSE</licenseUrl>
<Version>2.2.2</Version>
<Version>2.2.3</Version>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<AnalysisLevel>latest</AnalysisLevel>
Expand Down
4 changes: 1 addition & 3 deletions src/JT809.Protocol.Benchmark/JT809.Protocol.Benchmark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.2" />
<PackageReference Include="System.Buffers" Version="4.5.1" />
<PackageReference Include="System.Memory" Version="4.5.5" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/JT809.Protocol.Benchmark/JT809SerializerContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public class JT809SerializerContextConfig : ManualConfig
{
public JT809SerializerContextConfig()
{
AddJob(Job.Default.WithGcServer(false).WithToolchain(CsProjCoreToolchain.NetCoreApp60).WithPlatform(Platform.AnyCpu));
AddJob(Job.Default.WithGcServer(false).WithToolchain(CsProjCoreToolchain.NetCoreApp70).WithPlatform(Platform.AnyCpu));
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions src/JT809.Protocol.Test/JT809.Protocol.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<IsPackable>false</IsPackable>
<NoWarn>1701;1702;1591</NoWarn>
</PropertyGroup>
Expand All @@ -11,9 +11,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="JT808" Version="2.5.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="JT808" Version="2.5.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PrivateAssets>all</PrivateAssets>
Expand Down
17 changes: 11 additions & 6 deletions src/JT809.Protocol/JT809.Protocol.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,17 @@
<Compile Include="Enums\JT809_0x9502_SizeType.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
<PackageReference Include="System.Text.Encoding.CodePages" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
</ItemGroup>

<ItemGroup>
<Compile Update="Extensions\JT809PackageExtensionsTemplate.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
Expand Down

0 comments on commit 79acb7b

Please sign in to comment.