Open performanceautofiler[bot] opened 7 months ago
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch See info in area-owners.md if you want to be subscribed.
Related regressions: Windows x64: https://github.com/dotnet/perf-autofiling-issues/issues/32733 Linux x64: https://github.com/dotnet/perf-autofiling-issues/issues/32721
@EgorBot -arm64 -perf -commit bc2bd2bd77ecd7a7979a3ef815e3ff36881a1b94 vs 8e2655b932f5f5e184d289982bdc516576df0981 --disasm
using BenchmarkDotNet.Attributes;
using System.Buffers;
using System.Linq;
using System.Text;
BenchmarkDotNet.Running.BenchmarkRunner.Run<Perf_Ascii>(args: args);
public class Perf_Ascii
{
[Params(
128)] // vectorized code path
public int Size;
private byte[] _bytes, _sameBytes, _bytesDifferentCase;
private char[] _characters, _sameCharacters, _charactersDifferentCase;
[GlobalSetup]
public void Setup()
{
_bytes = new byte[Size];
_bytesDifferentCase = new byte[Size];
for (int i = 0; i < Size; i++)
{
// let ToLower and ToUpper perform the same amount of work
_bytes[i] = i % 2 == 0 ? (byte)'a' : (byte)'A';
_bytesDifferentCase[i] = i % 2 == 0 ? (byte)'A' : (byte)'a';
}
_sameBytes = _bytes.ToArray();
_characters = _bytes.Select(b => (char)b).ToArray();
_sameCharacters = _characters.ToArray();
_charactersDifferentCase = _bytesDifferentCase.Select(b => (char)b).ToArray();
}
[Benchmark]
[MemoryRandomization]
public OperationStatus ToUtf16() => Ascii.ToUtf16(_bytes, _characters, out _);
}
BenchmarkDotNet v0.13.12, Ubuntu 22.04.4 LTS (Jammy Jellyfish)
Unknown processor
Job-TGKDHM : .NET 9.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
Job-DZBMEA : .NET 9.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
OutlierMode=DontRemove MemoryRandomization=True
Method | Toolchain | Size | Mean | Error | Ratio | Code Size |
---|---|---|---|---|---|---|
ToUtf16 | Main | 128 | 15.32 ns | 0.337 ns | 1.00 | 220 B |
ToUtf16 | PR | 128 | 18.28 ns | 0.117 ns | 1.20 | 220 B |
See BDN_Artifacts.zip for details.
Flame graphs: Main vs PR (interactive!) Hot asm: Main vs PR Hot functions: Main vs PR
Will be fixed by https://github.com/dotnet/runtime/pull/102705
Pushing out to .NET10 since it is a minor perf regression.
Pushing out to .NET10 since it is a minor perf regression.
Some of these are upwards of 20%, and in the linked issues that appear to be deduped against this, they're measured in us rather than ns. Am I reading this incorrectly or is there other context I'm missing?
@JulieLeeMSFT ?
Run Information
Regressions in System.Text.Tests.Perf_Encoding
Test Report
Repro
General Docs link: https://github.com/dotnet/performance/blob/main/docs/benchmarking-workflow-dotnet-runtime.md
Run Information
Regressions in System.Text.Perf_Ascii
Test Report
Repro
General Docs link: https://github.com/dotnet/performance/blob/main/docs/benchmarking-workflow-dotnet-runtime.md