Skip to content

Commit

Permalink
v2.2.6
Browse files Browse the repository at this point in the history
1.升级net9
2.修复解析问题
  • Loading branch information
SmallChi committed Nov 19, 2024
1 parent 1173c2b commit 2348db0
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 41 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: 8.0.300
dotnet-version: 9.0.100
- name: dotnet info
run: dotnet --info
- name: dotnet restore
Expand Down
29 changes: 14 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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协议消息对照表

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": "8.0.300"
"version": "9.0.100"
}
}
4 changes: 2 additions & 2 deletions src/Info.props
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project>
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net7.0;net8.0;</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net8.0;net9.0;</TargetFrameworks>
<LangVersion>latest</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.5</Version>
<Version>2.2.6</Version>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<AnalysisLevel>latest</AnalysisLevel>
Expand Down
4 changes: 2 additions & 2 deletions src/JT809.Protocol.Benchmark/JT809.Protocol.Benchmark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" />
</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.NetCoreApp80).WithPlatform(Platform.AnyCpu));
AddJob(Job.Default.WithGcServer(false).WithToolchain(CsProjCoreToolchain.NetCoreApp90).WithPlatform(Platform.AnyCpu));
}
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
4 changes: 2 additions & 2 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>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<IsPackable>false</IsPackable>
<NoWarn>1701;1702;1591</NoWarn>
</PropertyGroup>
Expand All @@ -11,7 +11,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="JT808" Version="2.6.5" />
<PackageReference Include="JT808" Version="2.7.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit" Version="2.8.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public void Test_2019_4()
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);

}
Expand Down
2 changes: 1 addition & 1 deletion src/JT809.Protocol.Test/Simples/Demo5.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public void Test_2019_4()
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);

}
Expand Down
20 changes: 10 additions & 10 deletions src/JT809.Protocol/JT809.Protocol.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -82,25 +82,25 @@

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="System.Buffers" Version="4.5.1" />
<PackageReference Include="System.Buffers" Version="4.6.0" />
<PackageReference Include="System.Dynamic.Runtime" Version="4.3.0" />
<PackageReference Include="System.Memory" Version="4.5.5" />
<PackageReference Include="System.Memory" Version="4.6.0" />
<PackageReference Include="System.Reflection.Extensions" Version="4.3.0" />
<PackageReference Include="System.Text.Json" Version="8.0.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.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 Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="System.Text.Encoding.CodePages" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
</ItemGroup>

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

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

0 comments on commit 2348db0

Please sign in to comment.