{"id":15785057,"url":"https://github.com/Rick-van-Dam/QueryableCacheDotnet","last_synced_at":"2025-10-21T22:30:33.845Z","repository":{"id":175617270,"uuid":"652658525","full_name":"Barsonax/QueryableCacheDotnet","owner":"Barsonax","description":null,"archived":false,"fork":false,"pushed_at":"2023-06-17T14:44:27.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-11T20:32:05.565Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Barsonax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-12T14:26:05.000Z","updated_at":"2023-06-17T09:33:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"4c783283-cf3e-41f3-b0c1-7577ea0df04d","html_url":"https://github.com/Barsonax/QueryableCacheDotnet","commit_stats":{"total_commits":24,"total_committers":2,"mean_commits":12.0,"dds":0.5,"last_synced_commit":"917207ed5bd39b373072459e727f3986719459b1"},"previous_names":["barsonax/querycache","barsonax/queryablecachedotnet"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Barsonax%2FQueryableCacheDotnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Barsonax%2FQueryableCacheDotnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Barsonax%2FQueryableCacheDotnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Barsonax%2FQueryableCacheDotnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Barsonax","download_url":"https://codeload.github.com/Barsonax/QueryableCacheDotnet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237554813,"owners_count":19329094,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-04T20:20:46.967Z","updated_at":"2025-10-21T22:30:28.531Z","avatar_url":"https://github.com/Barsonax.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QueryableCacheDotnet\n\nI had a idea to create a extension method on a IQueryable\u003cT\u003e that caches the query output. I believed this should be possible as a IQueryable\u003cT\u003e is really just a expression tree that gets translated to SQL. By using the expression tree to calculate a cache key it does not matter what ORM is used as long as it uses IQueryable\u003cT\u003e. Furthermore a extension method on IQueryable\u003cT\u003e gives you alot of flexibility on when to apply caching and also works very well with method chaining.\n\n## Benchmarks\nAs calculating the cache keys should be as fast as possible benchmarks have been added in order to measure the time this takes:\n\n```\nBenchmarkDotNet=v0.13.5, OS=Windows 10 (10.0.19045.3086/22H2/2022Update)\nAMD Ryzen 9 3900X, 1 CPU, 24 logical and 12 physical cores\n  [Host]             : .NET Framework 4.8 (4.8.4644.0), X64 RyuJIT VectorSize=256\n  .NET 7.0           : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2\n  .NET Framework 4.8 : .NET Framework 4.8 (4.8.4644.0), X64 RyuJIT VectorSize=256\n\n\n|            Method |                Job |            Runtime | WhereClauses |      Mean |     Error |    StdDev |   Gen0 | Allocated |\n|------------------ |------------------- |------------------- |------------- |----------:|----------:|----------:|-------:|----------:|\n| CalculateCacheKey |           .NET 7.0 |           .NET 7.0 |            1 |  4.737 us | 0.0177 us | 0.0165 us | 0.3433 |   2.81 KB |\n| CalculateCacheKey | .NET Framework 4.8 | .NET Framework 4.8 |            1 | 17.715 us | 0.0377 us | 0.0315 us | 0.7629 |   4.88 KB |\n| CalculateCacheKey |           .NET 7.0 |           .NET 7.0 |            2 |  8.923 us | 0.0322 us | 0.0301 us | 0.5951 |   4.88 KB |\n| CalculateCacheKey | .NET Framework 4.8 | .NET Framework 4.8 |            2 | 34.120 us | 0.0942 us | 0.0881 us | 1.4038 |   8.99 KB |\n| CalculateCacheKey |           .NET 7.0 |           .NET 7.0 |            3 | 13.042 us | 0.0374 us | 0.0331 us | 0.8850 |   7.34 KB |\n| CalculateCacheKey | .NET Framework 4.8 | .NET Framework 4.8 |            3 | 50.303 us | 0.1524 us | 0.1425 us | 2.1362 |  13.49 KB |\n| CalculateCacheKey |           .NET 7.0 |           .NET 7.0 |            4 | 17.254 us | 0.0652 us | 0.0610 us | 1.1292 |    9.4 KB |\n| CalculateCacheKey | .NET Framework 4.8 | .NET Framework 4.8 |            4 | 65.648 us | 0.2358 us | 0.2206 us | 2.8076 |  17.61 KB |\n| CalculateCacheKey |           .NET 7.0 |           .NET 7.0 |            5 | 21.377 us | 0.0819 us | 0.0766 us | 1.3733 |  11.45 KB |\n| CalculateCacheKey | .NET Framework 4.8 | .NET Framework 4.8 |            5 | 81.581 us | 0.1786 us | 0.1583 us | 3.4180 |  21.72 KB |\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRick-van-Dam%2FQueryableCacheDotnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRick-van-Dam%2FQueryableCacheDotnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRick-van-Dam%2FQueryableCacheDotnet/lists"}