-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regressions in System.Buffers.Text.Tests.Utf8FormatterTests #78041
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Ping @TIHan . |
It looks like the optimization I did with Now, I manually tested, on my machine, Benchmark 1 public class Utf8FormatterTests
{
private readonly byte[] _destination = new byte[1000];
// This is using TryFormat(long value...).
[Benchmark]
public bool FormatterInt64() => Utf8Formatter.TryFormat(9223372036854775807, _destination, out _);
} Before #77137 BenchmarkDotNet=v0.13.3, OS=Windows 11 (10.0.22621.963)
AMD Ryzen 9 7950X, 1 CPU, 32 logical and 16 physical cores
.NET SDK=7.0.101
[Host] : .NET 7.0.1 (7.0.122.56804), X64 RyuJIT AVX2
Job-TYOOUA : .NET 8.0.0 (42.42.42.42424), X64 RyuJIT AVX2
Toolchain=CoreRun
| Method | Mean | Error | StdDev |
|--------------- |---------:|---------:|---------:|
| FormatterInt64 | 19.25 ns | 0.033 ns | 0.030 ns | After #77137 BenchmarkDotNet=v0.13.3, OS=Windows 11 (10.0.22621.963)
AMD Ryzen 9 7950X, 1 CPU, 32 logical and 16 physical cores
.NET SDK=7.0.101
[Host] : .NET 7.0.1 (7.0.122.56804), X64 RyuJIT AVX2
Job-OYHQOX : .NET 8.0.0 (42.42.42.42424), X64 RyuJIT AVX2
Toolchain=CoreRun
| Method | Mean | Error | StdDev |
|--------------- |---------:|---------:|---------:|
| FormatterInt64 | 18.35 ns | 0.092 ns | 0.086 ns | The example above shows that #77137 is improvement, at least on my machine. Benchmark 2 public class Utf8FormatterTests
{
private readonly byte[] _destination = new byte[1000];
[MethodImpl(MethodImplOptions.NoInlining)]
public bool FormatterInt64(long value) => Utf8Formatter.TryFormat(value, _destination, out _);
[Benchmark]
public bool FormatterInt64() => FormatterInt64(9223372036854775807);
} Before #77137 BenchmarkDotNet=v0.13.3, OS=Windows 11 (10.0.22621.963)
AMD Ryzen 9 7950X, 1 CPU, 32 logical and 16 physical cores
.NET SDK=7.0.101
[Host] : .NET 7.0.1 (7.0.122.56804), X64 RyuJIT AVX2
Job-VVQGGN : .NET 8.0.0 (42.42.42.42424), X64 RyuJIT AVX2
Toolchain=CoreRun
| Method | Mean | Error | StdDev |
|--------------- |---------:|---------:|---------:|
| FormatterInt64 | 19.61 ns | 0.080 ns | 0.075 ns | After #77137 BenchmarkDotNet=v0.13.3, OS=Windows 11 (10.0.22621.963)
AMD Ryzen 9 7950X, 1 CPU, 32 logical and 16 physical cores
.NET SDK=7.0.101
[Host] : .NET 7.0.1 (7.0.122.56804), X64 RyuJIT AVX2
Job-GQAVBD : .NET 8.0.0 (42.42.42.42424), X64 RyuJIT AVX2
Toolchain=CoreRun
| Method | Mean | Error | StdDev |
|--------------- |---------:|---------:|---------:|
| FormatterInt64 | 19.62 ns | 0.047 ns | 0.039 ns | The example above shows that there is basically no difference. @dotnet/jit-contrib how should I move forward with this? Maybe test more hardware? |
cc @EgorBo |
I would not bother since there is no clear suspect, on the global scale it looks like a bimodal behavior so I'd close this |
Run Information
Regressions in System.Buffers.Text.Tests.Utf8FormatterTests
Test Report
Repro
Related Issues
Regressions
Improvements
Payloads
Baseline
Compare
Histogram
Edge Detector Info
Collection Data
System.Buffers.Text.Tests.Utf8FormatterTests.FormatterInt64(value: 9223372036854775807)
Description of detection logic
Description of detection logic
Docs
Profiling workflow for dotnet/runtime repository
Benchmarking workflow for dotnet/runtime repository
The text was updated successfully, but these errors were encountered: