Skip to content

Commit

Permalink
Release 5.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
sakno committed Feb 17, 2024
1 parent 408de88 commit 6b9d024
Show file tree
Hide file tree
Showing 44 changed files with 256 additions and 176 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
Release Notes
====

# 02-17-2024
<a href="https://www.nuget.org/packages/dotnext/5.0.2">DotNext 5.0.2</a>
* Fixed XML docs

<a href="https://www.nuget.org/packages/dotnext.metaprogramming/5.0.2">DotNext.Metaprogramming 5.0.2</a>
* Fixed [223](https://github.com/dotnet/dotNext/issues/223)

<a href="https://www.nuget.org/packages/dotnext.unsafe/5.0.2">DotNext.Unsafe 5.0.2</a>
* Updated dependencies

<a href="https://www.nuget.org/packages/dotnext.threading/5.0.2">DotNext.Threading 5.0.2</a>
* Added correct validation for maximum possible timeout for all `WaitAsync` methods

<a href="https://www.nuget.org/packages/dotnext.io/5.0.2">DotNext.IO 5.0.2</a>
* Updated dependencies

<a href="https://www.nuget.org/packages/dotnext.net.cluster/5.0.2">DotNext.Net.Cluster 5.0.2</a>
* Prevent indexing of WAL files on Windows

<a href="https://www.nuget.org/packages/dotnext.aspnetcore.cluster/5.0.2">DotNext.AspNetCore.Cluster 5.0.2</a>
* Updated dependencies

# 01-23-2024
<a href="https://www.nuget.org/packages/dotnext/5.0.1">DotNext 5.0.1</a>
* Smallish performance improvements of dynamic buffers
Expand Down
27 changes: 12 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,30 +44,27 @@ 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: 01-23-2024
Release Date: 02-17-2024

<a href="https://www.nuget.org/packages/dotnext/5.0.1">DotNext 5.0.1</a>
* Smallish performance improvements of dynamic buffers
<a href="https://www.nuget.org/packages/dotnext/5.0.2">DotNext 5.0.2</a>
* Fixed XML docs

<a href="https://www.nuget.org/packages/dotnext.metaprogramming/5.0.1">DotNext.Metaprogramming 5.0.1</a>
* Updated dependencies
<a href="https://www.nuget.org/packages/dotnext.metaprogramming/5.0.2">DotNext.Metaprogramming 5.0.2</a>
* Fixed [223](https://github.com/dotnet/dotNext/issues/223)

<a href="https://www.nuget.org/packages/dotnext.unsafe/5.0.1">DotNext.Unsafe 5.0.1</a>
<a href="https://www.nuget.org/packages/dotnext.unsafe/5.0.2">DotNext.Unsafe 5.0.2</a>
* Updated dependencies

<a href="https://www.nuget.org/packages/dotnext.threading/5.0.1">DotNext.Threading 5.0.1</a>
* Updated dependencies
<a href="https://www.nuget.org/packages/dotnext.threading/5.0.2">DotNext.Threading 5.0.2</a>
* Added correct validation for maximum possible timeout for all `WaitAsync` methods

<a href="https://www.nuget.org/packages/dotnext.io/5.0.1">DotNext.IO 5.0.1</a>
* Improved performance of `FileWriter` and `FileBufferingWriter` classes by utilizing Scatter/Gather IO
* Reduced memory allocations required by async methods of `FileWriter` and `FileBufferingWriter` classes
<a href="https://www.nuget.org/packages/dotnext.io/5.0.2">DotNext.IO 5.0.2</a>
* Updated dependencies

<a href="https://www.nuget.org/packages/dotnext.net.cluster/5.0.1">DotNext.Net.Cluster 5.0.1</a>
* Improved IO performance of Persistent WAL due to related improvements in DotNext.IO library
* Updated dependencies
<a href="https://www.nuget.org/packages/dotnext.net.cluster/5.0.2">DotNext.Net.Cluster 5.0.2</a>
* Prevent indexing of WAL files on Windows

<a href="https://www.nuget.org/packages/dotnext.aspnetcore.cluster/5.0.1">DotNext.AspNetCore.Cluster 5.0.1</a>
<a href="https://www.nuget.org/packages/dotnext.aspnetcore.cluster/5.0.2">DotNext.AspNetCore.Cluster 5.0.2</a>
* Updated dependencies

Changelog for previous versions located [here](./CHANGELOG.md).
Expand Down
8 changes: 4 additions & 4 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,22 @@
</ItemGroup>
<ItemGroup>
<!--Microsoft packages-->
<PackageVersion Include="Microsoft.AspNetCore.Connections.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Connections.Abstractions" Version="8.0.2" />
<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.8.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
</ItemGroup>
<ItemGroup>
<!--Misc packages-->
<PackageVersion Include="BenchmarkDotNet" Version="0.13.12" />
<PackageVersion Include="FastMember.Signed" Version="1.5.0" />
<PackageVersion Include="xunit" Version="2.6.5" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.6"/>
<PackageVersion Include="xunit" Version="2.7.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.7"/>
<PackageVersion Include="coverlet.collector" Version="6.0.0"/>
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion src/DotNext.IO/DotNext.IO.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<Authors>.NET Foundation and Contributors</Authors>
<Company />
<Product>.NEXT Family of Libraries</Product>
<VersionPrefix>5.0.1</VersionPrefix>
<VersionPrefix>5.0.2</VersionPrefix>
<VersionSuffix></VersionSuffix>
<AssemblyName>DotNext.IO</AssemblyName>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down
2 changes: 1 addition & 1 deletion src/DotNext.Metaprogramming/DotNext.Metaprogramming.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<ImplicitUsings>true</ImplicitUsings>
<IsTrimmable>false</IsTrimmable>
<Features>nullablePublicOnly</Features>
<VersionPrefix>5.0.1</VersionPrefix>
<VersionPrefix>5.0.2</VersionPrefix>
<VersionSuffix></VersionSuffix>
<Authors>.NET Foundation</Authors>
<Product>.NEXT Family of Libraries</Product>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ public AsyncResultExpression(bool valueTask)
/// </remarks>
public override Type Type => taskType;

// indicates that AsyncResult cannot throw exception so it can be inlined
internal bool IsSimpleResult
=> AsyncResult is ConstantExpression or ParameterExpression or DefaultExpression;

/// <summary>
/// Translates this expression into predefined set of expressions
/// using Lowering technique.
Expand Down Expand Up @@ -103,4 +107,7 @@ protected override AsyncResultExpression VisitChildren(ExpressionVisitor visitor
var expression = visitor.Visit(AsyncResult);
return ReferenceEquals(expression, AsyncResult) ? this : new(expression, taskType);
}

internal AsyncResultExpression Update(Expression asyncResult)
=> new(asyncResult, taskType);
}
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ public override Expression Reduce()
if (indexer is null)
result = ArrayAccess(temp ?? Collection, Index);
else if (count is null)
result = MakeIndex(temp ?? Collection, indexer, new[] { Index.Reduce() });
result = MakeIndex(temp ?? Collection, indexer, [Index.Reduce()]);
else
result = MakeIndex(temp ?? Collection, indexer, new[] { MakeIndex(temp ?? Collection, count, Index) });
result = MakeIndex(temp ?? Collection, indexer, [MakeIndex(temp ?? Collection, count, Index)]);

return temp is null ? result : Block(Type, new[] { temp }, Assign(temp, Collection), result);
return temp is null ? result : Block(Type, [temp], Assign(temp, Collection), result);
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,7 @@ internal static Expression AddEpilogue(this Expression expression, bool inferTyp
[DynamicDependency(DynamicallyAccessedMemberTypes.PublicMethods, typeof(Activator))]
public static MethodCallExpression New(this Expression type, params Expression[] args)
{
var activate = typeof(Activator).GetMethod(nameof(Activator.CreateInstance), new[] { typeof(Type), typeof(object[]) });
var activate = typeof(Activator).GetMethod(nameof(Activator.CreateInstance), [typeof(Type), typeof(object[])]);
Debug.Assert(activate is not null);
return Expression.Call(activate, type, Expression.NewArrayInit(typeof(object), args));
}
Expand Down Expand Up @@ -1456,9 +1456,9 @@ public static Expression AsOptional(this Expression expression)
public static Expression AsResult(this Expression expression)
{
var exception = Expression.Parameter(typeof(Exception));
var ctor = typeof(Result<>).MakeGenericType(expression.Type).GetConstructor(new[] { expression.Type });
var ctor = typeof(Result<>).MakeGenericType(expression.Type).GetConstructor([expression.Type]);
Debug.Assert(ctor?.DeclaringType is not null);
var fallbackCtor = ctor.DeclaringType.GetConstructor(new[] { typeof(Exception) });
var fallbackCtor = ctor.DeclaringType.GetConstructor([typeof(Exception)]);
Debug.Assert(fallbackCtor is not null);
return Expression.TryCatch(
Expression.New(ctor, expression),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,19 +105,19 @@ private Expression MakePlainString()
case 0:
return Constant(Format);
case 1:
var formatMethod = typeof(string).GetMethod(nameof(string.Format), new[] { typeof(IFormatProvider), typeof(string), typeof(object) });
var formatMethod = typeof(string).GetMethod(nameof(string.Format), [typeof(IFormatProvider), typeof(string), typeof(object)]);
Debug.Assert(formatMethod is not null);
return Call(formatMethod, FormatProvider, Constant(Format), arguments[0]);
case 2:
formatMethod = typeof(string).GetMethod(nameof(string.Format), new[] { typeof(IFormatProvider), typeof(string), typeof(object), typeof(object) });
formatMethod = typeof(string).GetMethod(nameof(string.Format), [typeof(IFormatProvider), typeof(string), typeof(object), typeof(object)]);
Debug.Assert(formatMethod is not null);
return Call(formatMethod, FormatProvider, Constant(Format), FormatProvider, arguments[0], arguments[1]);
case 3:
formatMethod = typeof(string).GetMethod(nameof(string.Format), new[] { typeof(IFormatProvider), typeof(string), typeof(object), typeof(object), typeof(object) });
formatMethod = typeof(string).GetMethod(nameof(string.Format), [typeof(IFormatProvider), typeof(string), typeof(object), typeof(object), typeof(object)]);
Debug.Assert(formatMethod is not null);
return Call(formatMethod, FormatProvider, Constant(Format), FormatProvider, arguments[0], arguments[1], arguments[2]);
default:
formatMethod = typeof(string).GetMethod(nameof(string.Format), new[] { typeof(IFormatProvider), typeof(string), typeof(object[]) });
formatMethod = typeof(string).GetMethod(nameof(string.Format), [typeof(IFormatProvider), typeof(string), typeof(object[])]);
Debug.Assert(formatMethod is not null);
return Call(formatMethod, FormatProvider, Constant(Format), FormatProvider, NewArrayInit(typeof(object), arguments));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ internal static Expression GetOffset(Expression index, Expression count)
/// <returns>Translated expression.</returns>
public override Expression Reduce()
{
ConstructorInfo? ctor = typeof(Index).GetConstructor(new[] { typeof(int), typeof(bool) });
ConstructorInfo? ctor = typeof(Index).GetConstructor([typeof(int), typeof(bool)]);
Debug.Assert(ctor is not null);
return New(ctor, conversionRequired ? Convert(Value, typeof(int)) : Value, Constant(IsFromEnd));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ public Expression Body
[DynamicDependency(DynamicallyAccessedMemberTypes.PublicMethods, typeof(Monitor))]
public override Expression Reduce()
{
var monitorEnter = typeof(Monitor).GetMethod(nameof(Monitor.Enter), new[] { typeof(object) });
var monitorEnter = typeof(Monitor).GetMethod(nameof(Monitor.Enter), [typeof(object)]);
Debug.Assert(monitorEnter is not null);
var monitorExit = typeof(Monitor).GetMethod(nameof(Monitor.Exit), new[] { typeof(object) });
var monitorExit = typeof(Monitor).GetMethod(nameof(Monitor.Exit), [typeof(object)]);
Debug.Assert(monitorExit is not null);
var body = TryFinally(Body, Call(monitorExit, SyncRoot));
return assignment is null ?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ private static Expression ToExpression(DynamicMetaObject arg, out BindingRestric
}
}

return Expression.Call(typeof(ExpressionBuilder), nameof(ExpressionBuilder.Const), new[] { arg.Expression.Type }, arg.Expression);
return Expression.Call(typeof(ExpressionBuilder), nameof(ExpressionBuilder.Const), [arg.Expression.Type], arg.Expression);
}

private static IReadOnlyList<Expression> ToExpressions(DynamicMetaObject[] args, out BindingRestrictions restrictions)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ public override Expression Reduce()
if (Bindings.Count > 0)
{
var tempVar = Parameter(Type, "copy");
ICollection<Expression> statements = new List<Expression>(Bindings.Count + 2) { Assign(tempVar, result) };
List<Expression> statements = new(Bindings.Count + 2) { Assign(tempVar, result) };

foreach (var binding in Bindings)
statements.Add(Assign(MakeMemberAccess(tempVar, binding.Member), binding.Expression));

statements.Add(tempVar);
result = Block(tempVar.Type, new[] { tempVar }, statements);
result = Block(tempVar.Type, [tempVar], statements);
}

return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public override Expression Reduce()

return Block(
Left.Type,
new[] { localVar },
[localVar],
Assign(localVar, Left),
Assign(Left, Build(localVar, Right)),
localVar);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ internal static Expression GetOffsetAndLength(Expression range, Expression lengt
/// <returns>Translated expression.</returns>
public override Expression Reduce()
{
ConstructorInfo? ctor = typeof(Range).GetConstructor(new[] { typeof(Index), typeof(Index) });
ConstructorInfo? ctor = typeof(Range).GetConstructor([typeof(Index), typeof(Index)]);
Debug.Assert(ctor is not null);
return New(ctor, Start.Reduce(), End.Reduce());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ public RefAnyValExpression(ParameterExpression typedRef, Type referenceType)
/// using Lowering technique.
/// </summary>
/// <returns>Translated expression.</returns>
public override Expression Reduce() => Call(typeof(Intrinsics), nameof(Intrinsics.AsRef), new[] { ReferenceType }, TypedReferenceVar);
public override Expression Reduce() => Call(typeof(Intrinsics), nameof(Intrinsics.AsRef), [ReferenceType], TypedReferenceVar);
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private static IEnumerable<MethodInfo> GetSliceMethods(Type collection)
[DynamicDependency(DynamicallyAccessedMemberTypes.PublicMethods, typeof(RuntimeHelpers))]
private static MethodCallExpression SubArray(Expression array, Expression range)
{
MethodInfo? subArray = typeof(RuntimeHelpers).GetMethod(nameof(RuntimeHelpers.GetSubArray), 1, new[] { Type.MakeGenericMethodParameter(0).MakeArrayType(), typeof(Range) });
MethodInfo? subArray = typeof(RuntimeHelpers).GetMethod(nameof(RuntimeHelpers.GetSubArray), 1, [Type.MakeGenericMethodParameter(0).MakeArrayType(), typeof(Range)]);
Debug.Assert(subArray is not null);
subArray = subArray.MakeGenericMethod(array.Type.GetElementType()!);
return Call(subArray, array, range.Reduce());
Expand All @@ -108,7 +108,7 @@ private static MethodCallExpression SubArray(Expression array, Expression range)
private static BlockExpression SubCollection(Expression collection, MethodInfo slice, PropertyInfo count, Expression range)
{
var offsetAndLengthCall = RangeExpression.GetOffsetAndLength(range, Property(collection, count), out var offsetAndLength, out var offsetField, out var lengthField);
return Block(new[] { offsetAndLength }, Assign(offsetAndLength, offsetAndLengthCall), Call(collection, slice, offsetField, lengthField));
return Block([offsetAndLength], Assign(offsetAndLength, offsetAndLengthCall), Call(collection, slice, offsetField, lengthField));
}

/// <summary>
Expand All @@ -127,7 +127,7 @@ public override Expression Reduce()
else
result = SubCollection(temp ?? Collection, slice, count, Range);

return temp is null ? result : Block(Type, new[] { temp }, Assign(temp, Collection), result);
return temp is null ? result : Block(Type, [temp], Assign(temp, Collection), result);
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private WriteLineExpression(Expression value, Kind kind)
[DynamicDependency(DynamicallyAccessedMemberTypes.PublicMethods, typeof(TextWriter))]
private static MethodCallExpression WriteLineTo(MemberExpression stream, Expression value)
{
MethodInfo? writeLineMethod = typeof(TextWriter).GetMethod(nameof(TextWriter.WriteLine), new[] { value.Type });
MethodInfo? writeLineMethod = typeof(TextWriter).GetMethod(nameof(TextWriter.WriteLine), [value.Type]);

// WriteLine method will always be resolved here because Type.DefaultBinder
// chooses TextWriter.WriteLine(object) if there is no exact match
Expand Down Expand Up @@ -91,7 +91,7 @@ private MethodCallExpression WriteLineToError()
[DynamicDependency(DynamicallyAccessedMemberTypes.PublicMethods, typeof(System.Diagnostics.Debug))]
private MethodCallExpression WriteLineToDebug()
{
var writeLineMethod = typeof(System.Diagnostics.Debug).GetMethod(nameof(System.Diagnostics.Debug.WriteLine), new[] { typeof(object) });
var writeLineMethod = typeof(System.Diagnostics.Debug).GetMethod(nameof(System.Diagnostics.Debug.WriteLine), [typeof(object)]);
System.Diagnostics.Debug.Assert(writeLineMethod is not null);
return Call(writeLineMethod, value.Type.IsValueType ? Convert(value, typeof(object)) : value);
}
Expand Down
Loading

0 comments on commit 6b9d024

Please sign in to comment.