Skip to content

Commit

Permalink
Merge with 5.0.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
sakno committed Jan 12, 2024
2 parents fdf2359 + 897dd8e commit 5ad7693
Show file tree
Hide file tree
Showing 780 changed files with 14,572 additions and 45,300 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Release Notes
====

# 01-10-2024
.NEXT 5.0.0 has been released! The primary goal of the new release is migration to .NET 8 to fully utilize its features such as [Generic Math](https://learn.microsoft.com/en-us/dotnet/standard/generics/math) and static abstract interface members. 5.x is not fully backward compatible with 4.x because of breaking changes in the API. Most of changes done in DotNext, DotNext.IO, and DotNext.Unsafe libraries. UDP transport for Raft is completely removed in favor of existing TCP implementation. There is a plan to implement multiplexed TCP connection and Raft sharding. New features:
* Numeric ranges for LINQ. Thanks to Generic Math
* Little-endian and big-endian readers/writer for various buffer types. Again thanks to Generic Math
* UTF-8 formatting support for various buffer types

DotNext.Reflection library is deprecated and no longer maintained.

# 11-19-2023
<a href="https://www.nuget.org/packages/dotnext.net.cluster/4.15.3">DotNext.Net.Cluster 4.15.3</a>
* `SustainedLowLatency` GC mode is now applied for heartbeats round initiated by heartbeat timeout. A round forced by replication programmatically doesn't set this mode that allows GC to be more intrusive. This trade-off provides better balance between memory consumption and replication time
Expand Down
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
Quick overview of additional features:

* [Attachment of user data to an arbitrary objects](https://dotnet.github.io/dotNext/features/core/userdata.html)
* Extended set of [atomic operations](https://dotnet.github.io/dotNext/features/core/atomic.html). Inspired by [AtomicInteger](https://docs.oracle.com/javase/10/docs/api/java/util/concurrent/atomic/AtomicInteger.html) and friends from Java
* Extended set of [atomic operations](https://dotnet.github.io/dotNext/features/core/atomic.html)
* Fast conversion of bytes to hexadecimal representation and vice versa with [Hex](https://dotnet.github.io/dotNext/api/DotNext.Buffers.Text.Hex.html) class
* `ManualResetEvent`, `ReaderWriterLockSlim` and other synchronization primitives now have their [asynchronous versions](https://dotnet.github.io/dotNext/features/threading/rwlock.html)
* [Atomic](https://dotnet.github.io/dotNext/features/core/atomic.html) memory access operations for arbitrary value types
Expand All @@ -44,14 +44,14 @@ All these things are implemented in 100% managed code on top of existing .NET AP
* [NuGet Packages](https://www.nuget.org/profiles/rvsakno)

# What's new
Release Date: 11-19-2023
Release Date: 01-10-2024

<a href="https://www.nuget.org/packages/dotnext.net.cluster/4.15.3">DotNext.Net.Cluster 4.15.3</a>
* `SustainedLowLatency` GC mode is now applied for heartbeats round initiated by heartbeat timeout. A round forced by replication programmatically doesn't set this mode that allows GC to be more intrusive. This trade-off provides better balance between memory consumption and replication time
* Updated dependencies
.NEXT 5.0.0 has been released! The primary goal of the new release is migration to .NET 8 to fully utilize its features such as [Generic Math](https://learn.microsoft.com/en-us/dotnet/standard/generics/math) and static abstract interface members. 5.x is not fully backward compatible with 4.x because of breaking changes in the API. Most of changes done in DotNext, DotNext.IO, and DotNext.Unsafe libraries. UDP transport for Raft is completely removed in favor of existing TCP implementation. There is a plan to implement multiplexed TCP connection and Raft sharding. New features:
* Numeric ranges for LINQ. Thanks to Generic Math
* Little-endian and big-endian readers/writer for various buffer types. Again thanks to Generic Math
* UTF-8 formatting support for various buffer types

<a href="https://www.nuget.org/packages/dotnext.aspnetcore.cluster/4.15.3">DotNext.AspNetCore.Cluster 4.15.3</a>
* Updated dependencies
DotNext.Reflection library is deprecated and no longer maintained.

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

Expand All @@ -64,7 +64,8 @@ The libraries are versioned according with [Semantic Versioning 2.0](https://sem
| 1.x | .NET Standard 2.0 | :x: |
| 2.x | .NET Standard 2.1 | :x: |
| 3.x | .NET Standard 2.1, .NET 5 | :x: |
| 4.x | .NET 6 | :heavy_check_mark: |
| 4.x | .NET 6 | :white_check_mark: |
| 5.x | .NET 8 | :heavy_check_mark: |

:x: - unsupported, :white_check_mark: - bug and security fixes only, :heavy_check_mark: - active development

Expand Down
4 changes: 4 additions & 0 deletions src/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ dotnet_diagnostic.SA1642.severity = none
dotnet_diagnostic.SA1643.severity = none
dotnet_diagnostic.SA1649.severity = none
dotnet_diagnostic.SX1101.severity = warning
dotnet_diagnostic.SA1010.severity = none

# CA1040: Avoid empty interfaces
dotnet_diagnostic.CA1040.severity = error
Expand Down Expand Up @@ -176,6 +177,9 @@ dotnet_diagnostic.CA2011.severity = error
# CA2014: Do not use stackalloc in loops
dotnet_diagnostic.CA2014.severity = error

# CA2016: Forward the CancellationToken parameter to methods that take one
dotnet_diagnostic.CA2016.severity = warning

# SA1106: Code should not contain empty statements
dotnet_diagnostic.SA1106.severity = none

Expand Down
28 changes: 13 additions & 15 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,26 @@
<!--Compile-time dependencies-->
<PackageVersion Include="Fody" Version="6.8.0"/>
<PackageVersion Include="InlineIL.Fody" Version="1.7.4"/>
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
<PackageVersion Include="StyleCop.Analyzers" Version="1.1.118"/>
</ItemGroup>
<ItemGroup>
<!--System packages-->
<PackageVersion Include="System.Collections.Immutable" Version="7.0.0" />
<PackageVersion Include="System.Collections.Immutable" Version="8.0.0" />
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
<PackageVersion Include="System.IO.Pipelines" Version="7.0.0" />
<PackageVersion Include="System.Resources.Extensions" Version="7.0.0"/>
<PackageVersion Include="System.Runtime.Caching" Version="7.0.0" />
<PackageVersion Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0"/>
<PackageVersion Include="System.Threading.Channels" Version="7.0.0" />
<PackageVersion Include="System.IO.Hashing" Version="8.0.0" />
<PackageVersion Include="System.IO.Pipelines" Version="8.0.0" />
<PackageVersion Include="System.Resources.Extensions" Version="8.0.0"/>
<PackageVersion Include="System.Runtime.Caching" Version="8.0.0" />
<PackageVersion Include="System.Threading.Channels" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<!--Microsoft packages-->
<PackageVersion Include="Microsoft.AspNetCore.Connections.Abstractions" Version="6.0.21" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.4" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="6.0.1" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Connections.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
<PackageVersion Include="Microsoft.IO.RecyclableMemoryStream" Version="2.3.2" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.7.1" />
</ItemGroup>
Expand Down
58 changes: 0 additions & 58 deletions src/DotNext.Benchmarks/ArrayEqualityBenchmark.cs

This file was deleted.

2 changes: 1 addition & 1 deletion src/DotNext.Benchmarks/Buffers/MemoryStreamingBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void WriteToSparseBuffer()
[Benchmark(Description = "PooledArrayBufferWriter<byte>")]
public void WriteToGrowableBuffer()
{
using var buffer = new PooledArrayBufferWriter<byte>();
using var buffer = new PoolingArrayBufferWriter<byte>();
using var ms = buffer.AsStream();
Write(ms);
}
Expand Down
2 changes: 1 addition & 1 deletion src/DotNext.Benchmarks/Buffers/SpanWriterBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void AddRangeToBufferWriterSlim()
[Benchmark]
public void AddRangeToArrayWriter()
{
using var writer = new PooledArrayBufferWriter<int> { Capacity = 10 };
using var writer = new PoolingArrayBufferWriter<int> { Capacity = 10 };
writer.Write(inputArray);
}

Expand Down
10 changes: 5 additions & 5 deletions src/DotNext.Benchmarks/Buffers/StringBuildingBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ public class StringBuildingBenchmark
[Benchmark]
public string BuildStringUsingPooledArrayBufferWriter()
{
using var writer = new PooledArrayBufferWriter<char>();
using var writer = new PoolingArrayBufferWriter<char>();
for (var i = 0; i < 100; i++)
{
writer.Write(StringValue);
writer.WriteFormattable(int.MaxValue);
writer.Format(int.MaxValue);
writer.WriteLine();
}

Expand All @@ -34,7 +34,7 @@ public string BuildStringUsingSparseBufferWriter()
for (var i = 0; i < 100; i++)
{
writer.Write(StringValue);
writer.WriteFormattable(int.MaxValue);
writer.Format(int.MaxValue);
writer.WriteLine();
}

Expand Down Expand Up @@ -69,7 +69,7 @@ public string BuildStringOnStackNoPreallocatedBuffer()
for (var i = 0; i < 100; i++)
{
writer.Write(StringValue);
writer.WriteFormattable(int.MaxValue);
writer.Format(int.MaxValue);
writer.WriteLine();
}

Expand All @@ -90,7 +90,7 @@ public string BuildStringOnStack()
for (var i = 0; i < 100; i++)
{
writer.Write(StringValue);
writer.WriteFormattable(int.MaxValue);
writer.Format(int.MaxValue);
writer.WriteLine();
}

Expand Down
33 changes: 0 additions & 33 deletions src/DotNext.Benchmarks/Buffers/StringTemplateRenderingBenchmark.cs

This file was deleted.

5 changes: 2 additions & 3 deletions src/DotNext.Benchmarks/DotNext.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>latest</LangVersion>
<EnableNETAnalyzers>false</EnableNETAnalyzers>
<RootNamespace>DotNext</RootNamespace>
<StartupObject>DotNext.Program</StartupObject>
<IsPackable>false</IsPackable>
<Version>4.14.0</Version>
<Version>5.0.0</Version>
<Authors>.NET Foundation and Contributors</Authors>
<Product>.NEXT Family of Libraries</Product>
<Description>Various benchmarks demonstrating performance aspects of .NEXT extensions</Description>
Expand Down Expand Up @@ -48,7 +48,6 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\DotNext.Reflection\DotNext.Reflection.csproj" />
<ProjectReference Include="..\DotNext\DotNext.csproj" />
<ProjectReference Include="..\DotNext.Metaprogramming\DotNext.Metaprogramming.csproj" />
<ProjectReference Include="..\DotNext.IO\DotNext.IO.csproj" />
Expand Down
18 changes: 3 additions & 15 deletions src/DotNext.Benchmarks/GenericEnumBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

namespace DotNext;

using Intrinsics = Runtime.Intrinsics;

[SimpleJob(runStrategy: RunStrategy.Throughput, launchCount: 1)]
[Orderer(SummaryOrderPolicy.FastestToSlowest)]
public class GenericEnumBenchmark
Expand All @@ -19,28 +17,18 @@ private static long ToInt64<T>(T value)
where T : struct, IConvertible
=> value.ToInt64(null);

private static T ToEnum<T>(int value)
where T : unmanaged, Enum
{
Intrinsics.Bitcast(value, out T result);
return result;
}

[Benchmark]
public int ToInt32UsingConstrainedCall() => ToInt32(EnvironmentVariableTarget.Machine);

[Benchmark]
public long ToInt64UsingConstrainedCall() => ToInt64(EnvironmentVariableTarget.Machine);

[Benchmark]
public int ToInt32UsingGenericConverter() => EnvironmentVariableTarget.Machine.ToInt32();

[Benchmark]
public long ToInt64UsingGenericConverter() => EnvironmentVariableTarget.Machine.ToInt64();
public int ToInt32UsingGenericConverter() => EnumConverter.FromEnum<EnvironmentVariableTarget, int>(EnvironmentVariableTarget.Machine);

[Benchmark]
public EnvironmentVariableTarget ToEnumUsingBitcast() => ToEnum<EnvironmentVariableTarget>(2);
public long ToInt64UsingGenericConverter() => EnumConverter.FromEnum<EnvironmentVariableTarget, long>(EnvironmentVariableTarget.Machine);

[Benchmark]
public EnvironmentVariableTarget ToEnumUsingGenericConverter() => 2.ToEnum<EnvironmentVariableTarget>();
public EnvironmentVariableTarget ToEnumUsingGenericConverter() => EnumConverter.ToEnum<EnvironmentVariableTarget, int>(2);
}
12 changes: 6 additions & 6 deletions src/DotNext.Benchmarks/IO/DictionarySerializationBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ public async Task SerializeToBinaryFormMemoryStream()
{
await using var output = new MemoryStream(1024);
var writer = IAsyncBinaryWriter.Create(output, buffer);
await writer.WriteInt32Async(data.Count, true);
await writer.WriteLittleEndianAsync(data.Count);

var context = new EncodingContext(Encoding.UTF8, true);
foreach (var (key, value) in data)
{
await writer.WriteStringAsync(key.AsMemory(), context, LengthFormat.Plain);
await writer.WriteStringAsync(value.AsMemory(), context, LengthFormat.Plain);
await writer.EncodeAsync(key.AsMemory(), context, LengthFormat.LittleEndian);
await writer.EncodeAsync(value.AsMemory(), context, LengthFormat.LittleEndian);
}
}

Expand All @@ -70,13 +70,13 @@ public async Task SerializeToBinaryFormFileStream()
{
await using var output = new FileStream(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()), FileMode.CreateNew, FileAccess.Write, FileShare.None, 1024, FileOptions.SequentialScan | FileOptions.Asynchronous | FileOptions.DeleteOnClose);
var writer = IAsyncBinaryWriter.Create(output, buffer);
await writer.WriteInt32Async(data.Count, true);
await writer.WriteLittleEndianAsync(data.Count);

var context = new EncodingContext(Encoding.UTF8, true);
foreach (var (key, value) in data)
{
await writer.WriteStringAsync(key.AsMemory(), context, LengthFormat.Plain);
await writer.WriteStringAsync(value.AsMemory(), context, LengthFormat.Plain);
await writer.EncodeAsync(key.AsMemory(), context, LengthFormat.LittleEndian);
await writer.EncodeAsync(value.AsMemory(), context, LengthFormat.LittleEndian);
}

await output.FlushAsync();
Expand Down
Loading

0 comments on commit 5ad7693

Please sign in to comment.