Repository navigation
Migrate to .NET 10 from .NET 8 - #1333
Conversation
| using (var fs = File.Open(filePath, FileMode.Open, FileAccess.Read)) | ||
| { | ||
| data = new byte[fs.Length - 32]; | ||
| fs.Read(data, 0, data.Length); |
There was a problem hiding this comment.
This reports an analyzer warning because it can return after a partial read.
| </PropertyGroup> | ||
| <PropertyGroup> | ||
| <TargetFrameworks>net472;netstandard2.1;netstandard2.0;net8.0</TargetFrameworks> | ||
| <TargetFrameworks>net10.0;net472;netstandard2.1;netstandard2.0</TargetFrameworks> |
There was a problem hiding this comment.
net10.0 TFM was moved everywhere to be the first entry in <TargetFrameworsk> to unify it in code.
| @@ -1,4 +1,4 @@ | |||
| #if !NET6_0_OR_GREATER && !NO_TUPLE | |||
| #if !NET10_0_OR_GREATER && !NO_TUPLE | |||
There was a problem hiding this comment.
Easier to find in the future
| @@ -6,47 +6,47 @@ env: | |||
| DOTNET_CLI_TELEMETRY_OPTOUT: 'true' | |||
| <PropertyGroup> | ||
| <OutputType>Exe</OutputType> | ||
| <TargetFrameworks>net8.0</TargetFrameworks> | ||
| <TargetFrameworks>net10.0</TargetFrameworks> |
| <ItemGroup> | ||
| <PackageReference Include="BenchmarkDotNet" Version="0.14.0" /> | ||
| <PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.14.0" /> | ||
| <PackageReference Include="BenchmarkDotNet" Version="0.15.8" /> |
There was a problem hiding this comment.
Required for .NET 10 support
| /// </summary> | ||
| public ExtPubKey(ReadOnlySpan<byte> bytes) | ||
| { | ||
| if (bytes == null) |
There was a problem hiding this comment.
Warning: span cannot be null
| #endif | ||
|
|
||
| #if NET10_0_OR_GREATER | ||
| public override string EncodeData(ReadOnlySpan<byte> data) |
There was a problem hiding this comment.
Added to avoid byte[] allocations.
…ffers to 4.6.1 from 4.5.0
| <PackageReference Include="Microsoft.CSharp" Version="4.7.0" /> | ||
| <PackageReference Include="xunit" Version="2.9.2" /> | ||
| <PackageReference Include="xunit.runner.visualstudio" Version="2.4.1"> | ||
| <PackageReference Include="xunit" Version="2.9.3" /> |
There was a problem hiding this comment.
xunit package is deprecated.
WalletWasabi/WalletWasabi#14864 - upgrade to xUnit v3 is not that hard
|
@Carti-it I find it weird that 8.0 was faster. |
Yes. It's unexpected. I would expect better times, or at worst the same times. Certainly not worse.
Yes. It was also slower. About the same as now.
I run tests with the debugger on and the .NET 10 code paths get hit. So I don't think this is the issue. |
|
@NicolasDorier Perhaps you can try to measure it on your machine. |
|
that was fast, even pinpointed on dotnet/runtime wow |
One thing that I cannot really explain is this:
master (net8.0)
PR (net10.0)
(This was measured with the latest BenchmarkDotNet version (v0.15.8) and I did the same for .NET 8. So that's not the reason.)
Decoding HEX on .NET 10 seems to be slower than on .NET 8. I think that all other perf improvements of .NET 10 outweighs this one but still I don't really know what the issue might be. I kept playing with it for a while but I don't know.
Perhaps
dotnet run -f net8.0 -c Release -- --runtimes net10.0,net8.0 --filter *HexBench*would be more fair comparison.I don't know.