Skip to content

Commit f0d82f7

Browse files
committed
Release 5.19.0
1 parent 16e80a7 commit f0d82f7

File tree

55 files changed

+1410
-510
lines changed

Some content is hidden

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

55 files changed

+1410
-510
lines changed

CHANGELOG.md

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

4+
# 03-03-2025
5+
<a href="https://www.nuget.org/packages/dotnext/5.19.0">DotNext 5.19.0</a>
6+
* Added `ConsoleLifetimeTokenSource` that exposes the cancellation token bounded to the console application lifetime
7+
* Added more pipelined methods to work with `Optional<T>` and `Result<T>` in async code
8+
9+
<a href="https://www.nuget.org/packages/dotnext.metaprogramming/5.19.0">DotNext.Metaprogramming 5.19.0</a>
10+
* Updated dependencies
11+
12+
<a href="https://www.nuget.org/packages/dotnext.unsafe/5.19.0">DotNext.Unsafe 5.19.0</a>
13+
* Updated dependencies
14+
15+
<a href="https://www.nuget.org/packages/dotnext.threading/5.19.0">DotNext.Threading 5.19.0</a>
16+
* Added weight-based cache on top of existing `RandomAccessCache<TKey, TValue>` class
17+
* Fixed potential race conditions within `RandomAccessCache<TKey, TValue>` class
18+
* `RandomAccessCache<TKey, TValue, TWeight>` can grow dynamically depending on the number of hash collisions
19+
20+
<a href="https://www.nuget.org/packages/dotnext.io/5.19.0">DotNext.IO 5.19.0</a>
21+
* Updated dependencies
22+
23+
<a href="https://www.nuget.org/packages/dotnext.net.cluster/5.19.0">DotNext.Net.Cluster 5.19.0</a>
24+
* Reused FNV1a hash implementation
25+
* Improved WAL performance if `WriteMode.NoFlush` is chosen
26+
27+
<a href="https://www.nuget.org/packages/dotnext.aspnetcore.cluster/5.19.0">DotNext.AspNetCore.Cluster 5.19.0</a>
28+
* Updated dependencies
29+
430
# 01-20-2025
531
<a href="https://www.nuget.org/packages/dotnext/5.18.0">DotNext 5.18.0</a>
632
* Introduced `FileUri` class that allows to convert Windows/Unix file names to URI according to `file://` scheme

README.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,29 +44,31 @@ 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: 01-20-2025
47+
Release Date: 03-03-2025
4848

49-
<a href="https://www.nuget.org/packages/dotnext/5.18.0">DotNext 5.18.0</a>
50-
* Introduced `FileUri` class that allows to convert Windows/Unix file names to URI according to `file://` scheme
49+
<a href="https://www.nuget.org/packages/dotnext/5.19.0">DotNext 5.19.0</a>
50+
* Added `ConsoleLifetimeTokenSource` that exposes the cancellation token bounded to the console application lifetime
51+
* Added more pipelined methods to work with `Optional<T>` and `Result<T>` in async code
5152

52-
<a href="https://www.nuget.org/packages/dotnext.metaprogramming/5.18.0">DotNext.Metaprogramming 5.18.0</a>
53-
* Introduced expression tree for unsigned right shift operator `>>>`
54-
55-
<a href="https://www.nuget.org/packages/dotnext.unsafe/5.18.0">DotNext.Unsafe 5.18.0</a>
53+
<a href="https://www.nuget.org/packages/dotnext.metaprogramming/5.19.0">DotNext.Metaprogramming 5.19.0</a>
5654
* Updated dependencies
5755

58-
<a href="https://www.nuget.org/packages/dotnext.threading/5.18.1">DotNext.Threading 5.18.1</a>
59-
* Synchronous `TryAcquire` implemented by `AsyncExclusiveLock` and `AsyncReaderWriterLock` are now implemented in portable way. Previously, WASM target was not supported. Additionally, the method supports lock stealing
60-
* Improved synchronous support for `RandomAccessCache` class
56+
<a href="https://www.nuget.org/packages/dotnext.unsafe/5.19.0">DotNext.Unsafe 5.19.0</a>
57+
* Updated dependencies
6158

62-
<a href="https://www.nuget.org/packages/dotnext.io/5.18.2">DotNext.IO 5.18.2</a>
63-
* Fixed issue of `PoolingBufferedStream` class when the stream has buffered bytes in the write buffer and `Position` is set to backward
64-
* Fixed [256](https://github.com/dotnet/dotNext/issues/256)
59+
<a href="https://www.nuget.org/packages/dotnext.threading/5.19.0">DotNext.Threading 5.19.0</a>
60+
* Added weight-based cache on top of existing `RandomAccessCache<TKey, TValue>` class
61+
* Fixed potential race conditions within `RandomAccessCache<TKey, TValue>` class
62+
* `RandomAccessCache<TKey, TValue, TWeight>` can grow dynamically depending on the number of hash collisions
6563

66-
<a href="https://www.nuget.org/packages/dotnext.net.cluster/5.18.0">DotNext.Net.Cluster 5.18.0</a>
64+
<a href="https://www.nuget.org/packages/dotnext.io/5.19.0">DotNext.IO 5.19.0</a>
6765
* Updated dependencies
6866

69-
<a href="https://www.nuget.org/packages/dotnext.aspnetcore.cluster/5.18.0">DotNext.AspNetCore.Cluster 5.18.0</a>
67+
<a href="https://www.nuget.org/packages/dotnext.net.cluster/5.19.0">DotNext.Net.Cluster 5.19.0</a>
68+
* Reused FNV1a hash implementation
69+
* Improved WAL performance if `WriteMode.NoFlush` is chosen
70+
71+
<a href="https://www.nuget.org/packages/dotnext.aspnetcore.cluster/5.19.0">DotNext.AspNetCore.Cluster 5.19.0</a>
7072
* Updated dependencies
7173

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

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ variables:
55
AotTestFolder: src/DotNext.AotTests
66
AotTestProject: $(AotTestFolder)/DotNext.AotTests.csproj
77
InternetAccess: false
8-
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
8+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: false
99
isMain: $[eq(variables['Build.SourceBranch'], 'refs/heads/master')]
1010
trigger:
1111
- master

src/DotNext.Benchmarks/BitwiseHashCodeBenchmark.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System;
55
using System.Collections.Generic;
66

7-
namespace DotNext.Benchmarks;
7+
namespace DotNext;
88

99
[SimpleJob(runStrategy: RunStrategy.Throughput, launchCount: 1)]
1010
[Orderer(SummaryOrderPolicy.Declared)]

src/DotNext.Benchmarks/DotNext.Benchmarks.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<RootNamespace>DotNext</RootNamespace>
99
<StartupObject>DotNext.Program</StartupObject>
1010
<IsPackable>false</IsPackable>
11-
<Version>5.17.0</Version>
11+
<Version>5.19.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>

src/DotNext.Benchmarks/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace DotNext;
99
internal static class Program
1010
{
1111
private static IConfig BenchConfig => DefaultConfig.Instance.AddJob(Job.Default.AsDefault()
12-
.WithArguments(new[] { new MsBuildArgument("/p:Optimize=true") })
12+
.WithArguments([new MsBuildArgument("/p:Optimize=true")])
1313
.WithCustomBuildConfiguration("Bench"));
1414

1515
static void Main(string[] args)
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
using System;
2+
using System.Collections.Concurrent;
3+
using System.Collections.Generic;
4+
using System.Threading.Tasks;
5+
using BenchmarkDotNet.Attributes;
6+
using BenchmarkDotNet.Engines;
7+
using BenchmarkDotNet.Order;
8+
9+
namespace DotNext.Runtime.Caching;
10+
11+
[SimpleJob(runStrategy: RunStrategy.Throughput, launchCount: 1)]
12+
[Orderer(SummaryOrderPolicy.FastestToSlowest)]
13+
public class RandomAccessCacheReadBenchmark
14+
{
15+
private const string Key = "a";
16+
private const int Value = 42;
17+
private const int Capacity = 2;
18+
19+
private Dictionary<string, int> dictionary;
20+
private ConcurrentDictionary<string, int> concurrentDictionary;
21+
private RandomAccessCache<string, int> cache;
22+
23+
[GlobalSetup(Target = nameof(GetValueFromDictionary))]
24+
public void SetupDictionary()
25+
{
26+
dictionary = new(Capacity)
27+
{
28+
{Key, Value},
29+
};
30+
}
31+
32+
[GlobalSetup(Target = nameof(GetValueFromConcurrentDictionary))]
33+
public void SetupConcurrentDictionary()
34+
{
35+
concurrentDictionary = new(15, Capacity);
36+
}
37+
38+
[GlobalSetup(Target = nameof(GetValueFromCache))]
39+
public async Task SetupCache()
40+
{
41+
cache = new(Capacity);
42+
using var session = await cache.ChangeAsync(Key);
43+
session.SetValue(Value);
44+
}
45+
46+
[Benchmark(Baseline = true)]
47+
public int GetValueFromDictionary()
48+
=> dictionary.GetValueOrDefault(Key, 0);
49+
50+
[Benchmark]
51+
public int GetValueFromConcurrentDictionary() => concurrentDictionary.GetValueOrDefault(Key, 0);
52+
53+
[Benchmark]
54+
public int GetValueFromCache()
55+
{
56+
int result;
57+
if (cache.TryRead(Key, out var session))
58+
{
59+
result = session.Value;
60+
Dispose(ref session);
61+
}
62+
else
63+
{
64+
result = 0;
65+
}
66+
67+
return result;
68+
69+
static void Dispose<T>(ref T obj)
70+
where T : struct, IDisposable => obj.Dispose();
71+
}
72+
}

src/DotNext.IO/DotNext.IO.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<Authors>.NET Foundation and Contributors</Authors>
1212
<Company />
1313
<Product>.NEXT Family of Libraries</Product>
14-
<VersionPrefix>5.18.2</VersionPrefix>
14+
<VersionPrefix>5.19.0</VersionPrefix>
1515
<VersionSuffix></VersionSuffix>
1616
<AssemblyName>DotNext.IO</AssemblyName>
1717
<PackageLicenseExpression>MIT</PackageLicenseExpression>

src/DotNext.IO/IO/DecodingTextReader.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,15 @@ private int ReadBuffer(Span<char> output)
4141
{
4242
var result = 0;
4343

44-
for (int maxBytes = encoding.GetMaxByteCount(output.Length), bytesConsumed, charsProduced; !sequence.IsEmpty && !output.IsEmpty; maxBytes -= bytesConsumed, result += charsProduced)
44+
for (var maxBytes = encoding.GetMaxByteCount(output.Length); !sequence.IsEmpty && !output.IsEmpty;)
4545
{
4646
var input = sequence.FirstSpan;
47-
decoder.Convert(input, output, maxBytes <= input.Length, out bytesConsumed, out charsProduced, out _);
47+
decoder.Convert(input, output, maxBytes <= input.Length, out var bytesConsumed, out var charsProduced, out _);
4848
sequence = sequence.Slice(bytesConsumed);
4949
output = output.Slice(charsProduced);
50+
51+
maxBytes -= bytesConsumed;
52+
result += charsProduced;
5053
}
5154

5255
return result;

src/DotNext.Metaprogramming/DotNext.Metaprogramming.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<ImplicitUsings>true</ImplicitUsings>
99
<IsAotCompatible>false</IsAotCompatible>
1010
<Features>nullablePublicOnly</Features>
11-
<VersionPrefix>5.18.0</VersionPrefix>
11+
<VersionPrefix>5.19.0</VersionPrefix>
1212
<VersionSuffix></VersionSuffix>
1313
<Authors>.NET Foundation</Authors>
1414
<Product>.NEXT Family of Libraries</Product>

0 commit comments

Comments
 (0)