Skip to content

Commit aae77e4

Browse files
committed
Release 5.22.0
1 parent 1a7cdc6 commit aae77e4

File tree

132 files changed

+4792
-1077
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+4792
-1077
lines changed

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
11
Release Notes
22
====
33

4+
# 05-25-2025
5+
<a href="https://www.nuget.org/packages/dotnext/5.22.0">DotNext 5.22.0</a>
6+
* Added `!` operator overloading for the result and optional types: [261](https://github.com/dotnet/dotNext/pull/261)
7+
8+
<a href="https://www.nuget.org/packages/dotnext.metaprogramming/5.22.0">DotNext.Metaprogramming 5.22.0</a>
9+
* Updated dependencies
10+
11+
<a href="https://www.nuget.org/packages/dotnext.unsafe/5.22.0">DotNext.Unsafe 5.22.0</a>
12+
* Updated dependencies
13+
14+
<a href="https://www.nuget.org/packages/dotnext.threading/5.22.0">DotNext.Threading 5.22.0</a>
15+
* Added `Interrupt` method to `AsyncTrigger` class
16+
17+
<a href="https://www.nuget.org/packages/dotnext.io/5.22.0">DotNext.IO 5.22.0</a>
18+
* Updated dependencies
19+
20+
<a href="https://www.nuget.org/packages/dotnext.net.cluster/5.22.0">DotNext.Net.Cluster 5.22.0</a>
21+
* Introduced a new `WriteAheadLog` experimental class as long-term replacement of `MemoryBasedStateMachine` and `DiskBasedStateMachine`. Both classes remain available in the current major version. However, they are subject to removal in the next major version. A new write-ahead log provides much better performance, simpler configuration and simpler API
22+
23+
<a href="https://www.nuget.org/packages/dotnext.aspnetcore.cluster/5.22.0">DotNext.AspNetCore.Cluster 5.22.0</a>
24+
* Added new configuration helper methods to support new write-ahead log
25+
426
# 04-08-2025
527
<a href="https://www.nuget.org/packages/dotnext/5.21.0">DotNext 5.21.0</a>
628
* Added `Disposable.CreateException()` protected method

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,28 +44,28 @@ All these things are implemented in 100% managed code on top of existing .NET AP
4444
* [NuGet Packages](https://www.nuget.org/profiles/rvsakno)
4545

4646
# What's new
47-
Release Date: 04-08-2025
47+
Release Date: 05-25-2025
4848

49-
<a href="https://www.nuget.org/packages/dotnext/5.21.0">DotNext 5.21.0</a>
50-
* Added `Disposable.CreateException()` protected method
49+
<a href="https://www.nuget.org/packages/dotnext/5.22.0">DotNext 5.22.0</a>
50+
* Added `!` operator overloading for the result and optional types: [261](https://github.com/dotnet/dotNext/pull/261)
5151

52-
<a href="https://www.nuget.org/packages/dotnext.metaprogramming/5.21.0">DotNext.Metaprogramming 5.21.0</a>
52+
<a href="https://www.nuget.org/packages/dotnext.metaprogramming/5.22.0">DotNext.Metaprogramming 5.22.0</a>
5353
* Updated dependencies
5454

55-
<a href="https://www.nuget.org/packages/dotnext.unsafe/5.21.0">DotNext.Unsafe 5.21.0</a>
55+
<a href="https://www.nuget.org/packages/dotnext.unsafe/5.22.0">DotNext.Unsafe 5.22.0</a>
5656
* Updated dependencies
5757

58-
<a href="https://www.nuget.org/packages/dotnext.threading/5.21.0">DotNext.Threading 5.21.0</a>
59-
* Added `Contains`, `ReplaceAsync` methods to `RandomAccessCache<TKey, TValue>` class as well as scanning enumerator
58+
<a href="https://www.nuget.org/packages/dotnext.threading/5.22.0">DotNext.Threading 5.22.0</a>
59+
* Added `Interrupt` method to `AsyncTrigger` class
6060

61-
<a href="https://www.nuget.org/packages/dotnext.io/5.21.0">DotNext.IO 5.21.0</a>
61+
<a href="https://www.nuget.org/packages/dotnext.io/5.22.0">DotNext.IO 5.22.0</a>
6262
* Updated dependencies
6363

64-
<a href="https://www.nuget.org/packages/dotnext.net.cluster/5.21.0">DotNext.Net.Cluster 5.21.0</a>
65-
* Updated dependencies
64+
<a href="https://www.nuget.org/packages/dotnext.net.cluster/5.22.0">DotNext.Net.Cluster 5.22.0</a>
65+
* Introduced a new `WriteAheadLog` experimental class as long-term replacement of `MemoryBasedStateMachine` and `DiskBasedStateMachine`. Both classes remain available in the current major version. However, they are subject to removal in the next major version. A new write-ahead log provides much better performance, simpler configuration and simpler API
6666

67-
<a href="https://www.nuget.org/packages/dotnext.aspnetcore.cluster/5.21.0">DotNext.AspNetCore.Cluster 5.21.0</a>
68-
* Updated dependencies
67+
<a href="https://www.nuget.org/packages/dotnext.aspnetcore.cluster/5.22.0">DotNext.AspNetCore.Cluster 5.22.0</a>
68+
* Added new configuration helper methods to support new write-ahead log
6969

7070
Changelog for previous versions located [here](./CHANGELOG.md).
7171

src/Directory.Packages.props

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@
44
</PropertyGroup>
55
<ItemGroup>
66
<!--Compile-time dependencies-->
7-
<PackageVersion Include="Fody" Version="6.8.0"/>
8-
<PackageVersion Include="InlineIL.Fody" Version="1.7.4"/>
7+
<PackageVersion Include="Fody" Version="6.8.0" />
8+
<PackageVersion Include="InlineIL.Fody" Version="1.7.4" />
9+
<PackageVersion Include="Microsoft.FASTER.Core" Version="2.6.5" />
910
</ItemGroup>
1011
<ItemGroup>
1112
<!--System packages-->
1213
<PackageVersion Include="System.Collections.Immutable" Version="8.0.0" />
1314
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
1415
<PackageVersion Include="System.IO.Hashing" Version="8.0.0" />
1516
<PackageVersion Include="System.IO.Pipelines" Version="8.0.0" />
16-
<PackageVersion Include="System.Resources.Extensions" Version="8.0.0"/>
17+
<PackageVersion Include="System.Resources.Extensions" Version="8.0.0" />
1718
<PackageVersion Include="System.Runtime.Caching" Version="8.0.1" />
1819
<PackageVersion Include="System.Threading.Channels" Version="8.0.0" />
1920
</ItemGroup>
@@ -40,7 +41,7 @@
4041
<PackageVersion Include="BenchmarkDotNet" Version="0.14.0" />
4142
<PackageVersion Include="FastMember.Signed" Version="1.5.0" />
4243
<PackageVersion Include="xunit" Version="2.9.3" />
43-
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.2"/>
44-
<PackageVersion Include="coverlet.collector" Version="6.0.4"/>
44+
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.2" />
45+
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
4546
</ItemGroup>
4647
</Project>

src/DotNext.AotTests/DotNext.AotTests.csproj

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,12 @@
55
<RootNamespace>DotNext</RootNamespace>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
8-
<Version>5.17.0</Version>
8+
<Version>5.22.0</Version>
99
<IsPackable>false</IsPackable>
1010
<Authors>.NET Foundation and Contributors</Authors>
1111
<Product>.NEXT Family of Libraries</Product>
1212
<Description>AOT compatibility tests for .NEXT Familiy of Libraries</Description>
1313
<Copyright>Copyright © .NET Foundation and Contributors</Copyright>
14-
<PackageLicenseUrl>https://github.com/dotnet/DotNext/blob/master/LICENSE</PackageLicenseUrl>
15-
<PackageProjectUrl>https://github.com/dotnet/DotNext</PackageProjectUrl>
16-
<RepositoryUrl>https://github.com/dotnet/DotNext.git</RepositoryUrl>
17-
<RepositoryType>git</RepositoryType>
1814
<InvariantGlobalization>true</InvariantGlobalization>
1915
<PublishAot>true</PublishAot>
2016
</PropertyGroup>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
<IsPackable>false</IsPackable>
9+
<Authors>.NET Foundation and Contributors</Authors>
10+
<Product>.NEXT Family of Libraries</Product>
11+
<Copyright>Copyright © .NET Foundation and Contributors</Copyright>
12+
<RootNamespace>DotNext.Benchmarks.WAL</RootNamespace>
13+
<NoWarn>$(NoWarn);DOTNEXT001</NoWarn>
14+
<Version>5.22.0</Version>
15+
</PropertyGroup>
16+
17+
<ItemGroup>
18+
<PackageReference Include="Microsoft.FASTER.Core" />
19+
</ItemGroup>
20+
21+
<ItemGroup>
22+
<ProjectReference Include="..\cluster\DotNext.Net.Cluster\DotNext.Net.Cluster.csproj" />
23+
</ItemGroup>
24+
25+
</Project>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System.Diagnostics.CodeAnalysis;
2+
3+
namespace DotNext.Benchmarks.WAL;
4+
5+
using Net.Cluster.Consensus.Raft.StateMachine;
6+
7+
[Experimental("DOTNEXT001")]
8+
internal sealed class NoOpStateMachine : IStateMachine
9+
{
10+
ISnapshot? ISnapshotManager.Snapshot => null;
11+
12+
ValueTask ISnapshotManager.ReclaimGarbageAsync(long watermark, CancellationToken token)
13+
=> ValueTask.CompletedTask;
14+
15+
ValueTask<long> IStateMachine.ApplyAsync(LogEntry entry, CancellationToken token)
16+
=> ValueTask.FromResult(entry.Index);
17+
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
// See https://aka.ms/new-console-template for more information
2+
3+
using DotNext;
4+
using DotNext.Benchmarks.WAL;
5+
using DotNext.Diagnostics;
6+
using DotNext.Net.Cluster.Consensus.Raft;
7+
using DotNext.Net.Cluster.Consensus.Raft.StateMachine;
8+
using FASTER.core;
9+
10+
const int count = 2000;
11+
using var cts = new ConsoleLifetimeTokenSource();
12+
13+
Console.WriteLine("Starting DotNext WAL Performance Test...");
14+
await DotNextWalPerformanceTest(cts.Token).ConfigureAwait(false);
15+
16+
Console.WriteLine("Starting FASTER WAL Performance Test...");
17+
await FasterLogPerformanceTest(cts.Token).ConfigureAwait(false);
18+
19+
static async Task DotNextWalPerformanceTest(CancellationToken token)
20+
{
21+
var root = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
22+
23+
// page size is 512 KB
24+
var wal = new WriteAheadLog(new() { Location = root, ChunkMaxSize = 512 * 1024 }, new NoOpStateMachine());
25+
26+
try
27+
{
28+
Memory<byte> buffer = new byte[1024];
29+
Random.Shared.NextBytes(buffer.Span);
30+
31+
var index = 0L;
32+
var ts = new Timestamp();
33+
for (var i = 0; i < count; i++)
34+
{
35+
index = await wal.AppendAsync(buffer, token: token).ConfigureAwait(false);
36+
await wal.CommitAsync(index, token).ConfigureAwait(false);
37+
}
38+
39+
await wal.WaitForApplyAsync(index, token).ConfigureAwait(false);
40+
41+
Console.WriteLine($"Finished. Elapsed time: {ts.Elapsed}");
42+
}
43+
finally
44+
{
45+
await wal.DisposeAsync().ConfigureAwait(false);
46+
}
47+
}
48+
49+
static async Task FasterLogPerformanceTest(CancellationToken token)
50+
{
51+
using var linkedToken = CancellationTokenSource.CreateLinkedTokenSource(token);
52+
var root = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
53+
54+
// page size is 512 KB
55+
using var fasterLog = new FasterLog(new FasterLogSettings(root) { PageSize = 1L << 22 });
56+
var committer = Task.Run(async () =>
57+
{
58+
while (await fasterLog.WaitUncommittedAsync(fasterLog.TailAddress, linkedToken.Token).ConfigureAwait(false))
59+
{
60+
await fasterLog.CommitAsync(linkedToken.Token).ConfigureAwait(false);
61+
}
62+
}, linkedToken.Token);
63+
64+
Memory<byte> buffer = new byte[1024];
65+
Random.Shared.NextBytes(buffer.Span);
66+
67+
var ts = new Timestamp();
68+
for (var i = 0; i < count; i++)
69+
{
70+
await fasterLog.EnqueueAsync(buffer, token).ConfigureAwait(false);
71+
}
72+
73+
await fasterLog.CommitAsync(token).ConfigureAwait(false);
74+
Console.WriteLine($"Finished. Elapsed time: {ts.Elapsed}");
75+
linkedToken.Cancel();
76+
77+
await committer.ConfigureAwait(ConfigureAwaitOptions.SuppressThrowing);
78+
}

src/DotNext.Benchmarks/DotNext.Benchmarks.csproj

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,11 @@
88
<RootNamespace>DotNext</RootNamespace>
99
<StartupObject>DotNext.Program</StartupObject>
1010
<IsPackable>false</IsPackable>
11-
<Version>5.20.0</Version>
11+
<Version>5.22.0</Version>
1212
<Authors>.NET Foundation and Contributors</Authors>
1313
<Product>.NEXT Family of Libraries</Product>
1414
<Description>Various benchmarks demonstrating performance aspects of .NEXT extensions</Description>
1515
<Copyright>Copyright © .NET Foundation and Contributors</Copyright>
16-
<PackageLicenseExpression>MIT</PackageLicenseExpression>
17-
<PackageProjectUrl>https://github.com/dotnet/dotNext</PackageProjectUrl>
18-
<RepositoryUrl>https://github.com/dotnet/dotNext.git</RepositoryUrl>
19-
<RepositoryType>git</RepositoryType>
20-
<PackageTags>benchmarks</PackageTags>
2116
</PropertyGroup>
2217

2318
<PropertyGroup>

0 commit comments

Comments
 (0)