Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"husky": {
"version": "0.7.2",
"version": "0.8.0",
"commands": [
"husky"
],
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publush.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pullRequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
Expand Down
10 changes: 5 additions & 5 deletions benchmark/Benchmark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<RootNamespace>Benchmarks</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AutoBogus" Version="2.13.1" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.10" />
<PackageReference Include="BenchmarkDotNet" Version="0.15.6" />
<PackageReference Include="Fop" Version="1.0.3" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.7.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.DynamicLinq" Version="7.3.5" />
<PackageReference Include="Sieve" Version="2.5.5" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="5.0.0-2.final" />
<PackageReference Include="Microsoft.EntityFrameworkCore.DynamicLinq" Version="9.6.10" />
<PackageReference Include="Sieve" Version="3.0.0-beta0015" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions benchmark/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ public class Program
{
private static void Main()
{
// BenchmarkRunner.Run<LibraryComparisionFilteringBenchmark>();
BenchmarkRunner.Run<NativeLinqComparisonBenchmark>();
BenchmarkRunner.Run<LibraryComparisionFilteringBenchmark>();
//BenchmarkRunner.Run<NativeLinqComparisonBenchmark>();
// BenchmarkRunner.Run<LibraryComparisionFilteringBenchmark2>();
// BenchmarkRunner.Run<GridifyMapperUsages>();
// BenchmarkRunner.Run<QueryBuilderBuildBenchmark>();
Expand Down
2 changes: 1 addition & 1 deletion docs/.vitepress/configs/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const version: string = '2.17.0'
export const version: string = '2.17.1'
38 changes: 21 additions & 17 deletions docs/pages/guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,29 @@ To provide a better understanding of Gridify's functionality, we have prepared a

## Performance

Filtering is the most expensive feature in Gridify.
The following benchmark compares filtering in various popular dynamic LINQ libraries.
Interestingly, Gridify outperforms even Native LINQ in terms of speed.
It's worth mentioning that other features like Pagination and Sorting in Gridify have minimal impact on performance.

| Method | Mean | Error | StdDev | Ratio | Allocated | Alloc Ratio |
|------------------|-------------:|------------:|------------:|-------:|------------:|------------:|
| Gridify | 599.8 us | 2.76 us | 2.45 us | 0.92 | 36.36 KB | 1.11 |
| Native_LINQ | 649.9 us | 2.55 us | 2.38 us | 1.00 | 32.74 KB | 1.00 |
| DynamicLinq | 734.8 us | 13.90 us | 13.01 us | 1.13 | 119.4 KB | 3.65 |
| Sieve | 1,190.9 us | 7.41 us | 6.93 us | 1.83 | 53.05 KB | 1.62 |
| Fop | 2,637.6 us | 8.59 us | 7.61 us | 4.06 | 321.57 KB | 9.82 |
| CSharp_Scripting | 216,863.8 us | 4,295.66 us | 6,021.92 us | 336.64 | 23660.26 KB | 722.71 |
Filtering remains the most expensive operation in Gridify.
In .NET 8, Gridify was slightly faster than native LINQ, but with .NET 10 improvements to LINQ itself,
native performance has caught up.
The latest benchmark shows Gridify performing nearly identically to native LINQ,
while still clearly ahead of other dynamic LINQ libraries.
Pagination and sorting continue to have minimal performance impact.

| Method | Mean | Error | StdDev | Ratio | RatioSD | Allocated | Alloc Ratio |
|---------------------- |-----------:|----------:|----------:|-------:|--------:|------------:|------------:|
| Native_LINQ | 1.049 ms | 0.0047 ms | 0.0041 ms | 1.00 | 0.01 | 32.02 KB | 1.00 |
| Gridify | 1.079 ms | 0.0071 ms | 0.0066 ms | 1.03 | 0.01 | 34.76 KB | 1.09 |
| Gridify_WithoutMapper | 1.090 ms | 0.0074 ms | 0.0069 ms | 1.04 | 0.01 | 40.37 KB | 1.26 |
| Sieve | 1.216 ms | 0.0103 ms | 0.0097 ms | 1.16 | 0.01 | 44.21 KB | 1.38 |
| DynamicLinq | 1.284 ms | 0.0088 ms | 0.0082 ms | 1.22 | 0.01 | 92.42 KB | 2.89 |
| Fop | 4.749 ms | 0.0445 ms | 0.0416 ms | 4.53 | 0.04 | 284.77 KB | 8.89 |
| CSharp_Scripting | 224.708 ms | 4.4534 ms | 7.5621 ms | 214.24 | 7.17 | 23303.11 KB | 727.67 |

::: details
BenchmarkDotNet v0.13.10, Windows 11 (10.0.22621.2715/22H2/2022Update/SunValley2)
12th Gen Intel Core i7-12800H, 1 CPU, 20 logical and 14 physical cores
.NET SDK 8.0.100
[Host] : .NET 8.0.0 (8.0.23.53103), X64 RyuJIT AVX2
BenchmarkDotNet v0.15.6, Windows 11 (10.0.26200.7171)
AMD Ryzen 7 7800X3D 4.20GHz, 1 CPU, 8 logical and 8 physical cores
.NET SDK 10.0.100
[Host] : .NET 10.0.0 (10.0.0, 10.0.25.52411), X64 RyuJIT x86-64-v4
DefaultJob : .NET 10.0.0 (10.0.0, 10.0.25.52411), X64 RyuJIT x86-64-v4

This Benchmark is
available [Here](https://github.com/alirezanet/Gridify/blob/master/benchmark/LibraryComparisionFilteringBenchmark.cs)
Expand Down
4 changes: 2 additions & 2 deletions src/Gridify.Elasticsearch/Gridify.Elasticsearch.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageId>Gridify.Elasticsearch</PackageId>
<Version>2.17.0</Version>
<Version>2.17.1</Version>
<Authors>Alireza Sabouri; Dzmitry Koush</Authors>
<PackageDescription>Gridify (Elasticsearch), Easy way to apply Filtering, Sorting, and Pagination using text-based data.</PackageDescription>
<RepositoryUrl>https://github.com/alirezanet/Gridify</RepositoryUrl>
Expand All @@ -13,7 +13,7 @@
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<PackageReadmeFile>README.md</PackageReadmeFile>
<TargetFrameworks>net6.0;netstandard2.0;netstandard2.1;net7.0;net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>net10.0;netstandard2.0;netstandard2.1;net8.0;net9.0</TargetFrameworks>
<LangVersion>default</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
15 changes: 6 additions & 9 deletions src/Gridify.EntityFramework/Gridify.EntityFramework.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageId>Gridify.EntityFramework</PackageId>
<Version>2.17.0</Version>
<Version>2.17.1</Version>
<Authors>Alireza Sabouri</Authors>
<Company>TuxTeam</Company>
<PackageDescription>Gridify (EntityFramework), Easy and optimized way to apply Filtering, Sorting, and Pagination using text-based data.</PackageDescription>
Expand All @@ -14,7 +14,7 @@
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<PackageReadmeFile>README.md</PackageReadmeFile>
<TargetFrameworks>net6.0;netstandard2.0;netstandard2.1;net7.0;net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>net10.0;netstandard2.0;netstandard2.1;net8.0;net9.0</TargetFrameworks>
<LangVersion>default</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand All @@ -25,7 +25,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
Expand All @@ -34,16 +34,13 @@
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1' ">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="[2.0.0,5.0.0)" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="[6.0.0,7.0.0)" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="[7.0.0,8.0.0)" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="[8.0.0,10.0.0)" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="[9.0.0,10.0.0)" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="[10.0.0,11.0.0)" />
</ItemGroup>
</Project>
28 changes: 12 additions & 16 deletions src/Gridify/Gridify.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<PackageId>Gridify</PackageId>
<Version>2.17.0</Version>
<Version>2.17.1</Version>
<Authors>Alireza Sabouri</Authors>
<Company>TuxTeam</Company>
<PackageDescription>Gridify, Easy and optimized way to apply Filtering, Sorting, and Pagination using text-based data.</PackageDescription>
Expand All @@ -18,42 +18,38 @@
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageReadmeFile>README.md</PackageReadmeFile>
<TargetFrameworks>net6.0;netstandard2.0;netstandard2.1;net7.0;net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>net10.0;netstandard2.0;netstandard2.1;net8.0;net9.0</TargetFrameworks>

</PropertyGroup>

<ItemGroup>
<None Include="..\..\README.md" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="[9.0.0,10.0.0)" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="[8.0.0,10.0.0)" />
<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="[7.0.0,9.0.0)" />
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="[6.0.0,9.0.0)" />
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Memory" Version="4.5.4" />
<PackageReference Include="System.Memory" Version="4.6.3" />
<PackageReference Include="System.Reflection.Emit" Version="4.7.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />

</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<nullable>enable</nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" 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">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="10.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.0" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.0-rc.2" />
<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">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="10.0.0" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.0-rc.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
23 changes: 12 additions & 11 deletions test/EntityFrameworkPostgreSqlIntegrationTests/PR266Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,38 +24,39 @@ public void ISO_Should_Convert_ToUTC()
[Fact]
public void ISO_Should_ShowcaseDifferentConversions_LocalToUtc()
{
var localOffset = TimeZoneInfo.Local.GetUtcOffset(DateTime.Now);

var localDt = DateTime.Parse("2025-03-31T02:54:09Z");
var localDt = DateTime.Parse("2025-03-31T02:54:09Z"); // parsed as Local, value adjusted from Z
Assert.Equal(DateTimeKind.Local, localDt.Kind);

// Past behavior. Kind becomes Utc, but time is not converted.
// Past behavior: flips Kind only
var utcDtWrong = DateTime.SpecifyKind(localDt, DateTimeKind.Utc);
Assert.Equal(DateTimeKind.Utc, utcDtWrong.Kind);
Assert.Equal(localDt, utcDtWrong);

// Current behavior. Kind becomes Utc, and time is converted.
// Current behavior: converts to UTC using offset at that moment
var utcDtCorrect = localDt.ToUniversalTime();
Assert.Equal(DateTimeKind.Utc, utcDtCorrect.Kind);
Assert.Equal(localDt.Subtract(localOffset), utcDtCorrect);

var offsetAtThatTime = TimeZoneInfo.Local.GetUtcOffset(localDt);
Assert.Equal(localDt - offsetAtThatTime, utcDtCorrect);
}

[Fact]
public void ISO_Should_ShowcaseDifferentConversions_UtcToLocal()
{
var localOffset = TimeZoneInfo.Local.GetUtcOffset(DateTime.Now);

var utcDt = DateTime.Parse("2025-03-31T02:54:09Z").ToUniversalTime();
Assert.Equal(DateTimeKind.Utc, utcDt.Kind);

// Past behavior. Kind becomes Local, but time is not converted.
// Past behavior: flips Kind only
var localDtWrong = DateTime.SpecifyKind(utcDt, DateTimeKind.Local);
Assert.Equal(DateTimeKind.Local, localDtWrong.Kind);
Assert.Equal(utcDt, localDtWrong);

// Current behavior. Kind becomes Local, and time is converted.
// Current behavior: converts to Local using offset at that moment
var localDtCorrect = utcDt.ToLocalTime();
Assert.Equal(DateTimeKind.Local, localDtCorrect.Kind);
Assert.Equal(utcDt.Add(localOffset), localDtCorrect);

var offsetAtThatTime = TimeZoneInfo.Local.GetUtcOffset(utcDt); // offset for that UTC instant
Assert.Equal(utcDt + offsetAtThatTime, localDtCorrect);
}

}
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<RootNamespace>EntityFrameworkIntegrationTests.cs</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="10.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="xRetry" Version="1.9.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Loading
Loading