Skip to content

Commit cf85a5d

Browse files
authored
Merge branch 'main' into users/alexpeck/v2.4.0
2 parents ebb71dc + fcfd183 commit cf85a5d

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

BitFaster.Caching.Benchmarks/BitFaster.Caching.Benchmarks.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
<PackageReference Include="BenchmarkDotNet" Version="0.13.10" />
2323
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.10" />
2424
<PackageReference Include="MathNet.Numerics" Version="5.0.0" />
25-
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" />
26-
<PackageReference Include="System.Runtime.Caching" Version="7.0.0" />
25+
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.0" />
26+
<PackageReference Include="System.Runtime.Caching" Version="8.0.0" />
2727
</ItemGroup>
2828

2929
<ItemGroup>

BitFaster.Caching.HitRateAnalysis/BitFaster.Caching.HitRateAnalysis.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<NoWarn>NU1701</NoWarn>
2525
</PackageReference>
2626
<PackageReference Include="MathNet.Numerics" Version="5.0.0" />
27-
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" />
27+
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.0" />
2828
<PackageReference Include="Plotly.NET.CSharp" Version="0.11.1" />
2929
<PackageReference Include="Plotly.NET.ImageExport" Version="5.0.1" />
3030
</ItemGroup>

BitFaster.Caching.ThroughputAnalysis/BitFaster.Caching.ThroughputAnalysis.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
@@ -21,7 +21,7 @@
2121
<PackageReference Include="EasyConsole" Version="1.1.0">
2222
<NoWarn>NU1701</NoWarn>
2323
</PackageReference>
24-
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" />
24+
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.0" />
2525
<PackageReference Include="Plotly.NET.CSharp" Version="0.11.1" />
2626
<PackageReference Include="Plotly.NET.ImageExport" Version="5.0.1" />
2727
</ItemGroup>

BitFaster.Caching/BitFaster.Caching.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFrameworks>netstandard2.0;netcoreapp3.1;net6.0</TargetFrameworks>
@@ -52,7 +52,7 @@
5252
</ItemGroup>
5353

5454
<ItemGroup>
55-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
55+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
5656
</ItemGroup>
5757

5858
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">

BitFaster.Caching/ReadMe.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ var lru = new ConcurrentLru<string, SomeItem>(capacity);
1515
var value = lru.GetOrAdd("key", (key) => new SomeItem(key));
1616
```
1717

18+
Optionally configure `ConcurrentLru` with a [time-based eviction policy](https://github.com/bitfaster/BitFaster.Caching/wiki/ConcurrentLru:-Time%E2%80%90based-eviction), either:
19+
- Expire after write
20+
- Expire after access
21+
- Calculate an expiry time per item
22+
1823
## ConcurrentLfu
1924

2025
`ConcurrentLfu` is a drop in replacement for `ConcurrentDictionary`, but with bounded size enforced by the [W-TinyLFU admission policy](https://arxiv.org/pdf/1512.00727.pdf). `ConcurrentLfu` has near optimal hit rate and high scalability. Reads and writes are buffered then replayed asynchronously to mitigate lock contention.

0 commit comments

Comments
 (0)