Skip to content

Commit

Permalink
Merge pull request #28 from AinoraZ/AZ/feat/bump-dotnet-8
Browse files Browse the repository at this point in the history
Bump tests to .NET 8
  • Loading branch information
AinoraZ committed Nov 16, 2023
2 parents 8191bbc + b084a70 commit 5a179d3
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
dotnet-version: ["7.0.x"]
dotnet-version: ["8.0.x"]
steps:
- uses: actions/checkout@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
dotnet-version: ["7.0.x"]
dotnet-version: ["8.0.x"]
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"request": "launch",
"preLaunchTask": "build release",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/tests/Ainoraz.EFCore.IncludeBuilder.Benchmarks/bin/Release/net7.0/Ainoraz.EFCore.IncludeBuilder.Benchmarks.dll",
"program": "${workspaceFolder}/tests/Ainoraz.EFCore.IncludeBuilder.Benchmarks/bin/Release/net8.0/Ainoraz.EFCore.IncludeBuilder.Benchmarks.dll",
"args": [],
"cwd": "${workspaceFolder}/tests/Ainoraz.EFCore.IncludeBuilder.Benchmarks",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
Expand Down
12 changes: 6 additions & 6 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
<ItemGroup>
<PackageVersion Include="AutoFixture.AutoNSubstitute" Version="4.18.0" />
<PackageVersion Include="AutoFixture.Xunit2" Version="4.18.0" />
<PackageVersion Include="BenchmarkDotNet" Version="0.13.7" />
<PackageVersion Include="BenchmarkDotNet" Version="0.13.10" />
<PackageVersion Include="Castle.Core" Version="5.1.1" />
<PackageVersion Include="coverlet.collector" Version="6.0.0" />
<PackageVersion Include="FluentAssertions" Version="6.11.0" />
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="6.0.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.7.0" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<PackageVersion Include="MockQueryable.NSubstitute" Version="7.0.0" />
<PackageVersion Include="xunit" Version="2.5.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.0" />
<PackageVersion Include="xunit" Version="2.6.1" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.3" />
</ItemGroup>
</Project>
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,18 @@ EFCore.IncludeBuilder converts the includes you give it back to ```Include(...).

```UseIncludeBuilder``` adds very little overhead both time and memory wise:

| Method | Mean | Error | StdDev | Ratio | Gen 0 | Gen 1 | Allocated |
|------------------ |---------:|---------:|---------:|------:|-------:|-------:|----------:|
| Include | 66.42 μs | 0.291 μs | 0.272 μs | 1.00 | 0.7324 | 0.2441 | 14 KB |
| UseIncludeBuilder | 69.22 μs | 0.243 μs | 0.227 μs | 1.04 | 0.7324 | 0.2441 | 15 KB |
| Method | Mean | Error | StdDev | Ratio | RatioSD | Allocated | Alloc Ratio |
|------------------ |---------:|---------:|---------:|------:|--------:|----------:|------------:|
| Include | 30.89 μs | 0.572 μs | 0.535 μs | 1.00 | 0.00 | 10.53 KB | 1.00 |
| UseIncludeBuilder | 33.50 μs | 0.163 μs | 0.136 μs | 1.08 | 0.02 | 11.91 KB | 1.13 |


For larger queries that duplicate the same filters, it can even be the faster option:

| Method | Mean | Error | StdDev | Ratio | Gen 0 | Gen 1 | Allocated |
|------------------------- |---------:|--------:|--------:|------:|-------:|-------:|----------:|
| Include | 152.0 μs | 0.22 μs | 0.20 μs | 1.00 | 1.7090 | 0.4883 | 34 KB |
| Include_DuplicatedFilter | 186.7 μs | 0.70 μs | 0.65 μs | 1.23 | 2.1973 | 0.4883 | 41 KB |
| UseIncludeBuilder | 164.3 μs | 0.39 μs | 0.36 μs | 1.08 | 1.7090 | 0.4883 | 35 KB |
| Method | Mean | Error | StdDev | Ratio | Allocated | Alloc Ratio |
|------------------------- |---------:|---------:|---------:|------:|----------:|------------:|
| Include | 69.77 μs | 0.140 μs | 0.109 μs | 1.00 | 23.8 KB | 1.00 |
| Include_DuplicatedFilter | 87.86 μs | 0.177 μs | 0.148 μs | 1.26 | 29.93 KB | 1.26 |
| UseIncludeBuilder | 78.62 μs | 0.213 μs | 0.167 μs | 1.13 | 25.34 KB | 1.07 |

You can find the most up to date benchmarks in the build artifacts for each build.
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@

<ItemGroup Label="Package References">
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="all" />
<PackageReference Include="Microsoft.EntityFrameworkCore"/>
<PackageReference Include="Microsoft.EntityFrameworkCore" />
</ItemGroup>

<ItemGroup>
<None Include="$(SolutionDir)/README.md" Pack="true" PackagePath="/"/>
<None Include="$(SolutionDir)/README.md" Pack="true" PackagePath="/" />
</ItemGroup>
</Project>
6 changes: 3 additions & 3 deletions tests/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

<PropertyGroup>
<IsPackable>false</IsPackable>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<!-- Testing against latest EntityFrameworkCore for breaking changes. -->
<PackageReference Include="Microsoft.EntityFrameworkCore" VersionOverride="7.0.*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" VersionOverride="7.0.*" />
<PackageReference Include="Microsoft.EntityFrameworkCore" VersionOverride="8.0.*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" VersionOverride="8.0.*" />
</ItemGroup>
</Project>

0 comments on commit 5a179d3

Please sign in to comment.