Skip to content
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

EgorBot for xtqqczze in #108572 #113

Open
EgorBot opened this issue Oct 5, 2024 · 4 comments
Open

EgorBot for xtqqczze in #108572 #113

EgorBot opened this issue Oct 5, 2024 · 4 comments

Comments

@EgorBot
Copy link
Owner

EgorBot commented Oct 5, 2024

Processing dotnet/runtime#108572 (comment) command:

Command

-mono -intel -arm64

using System.Runtime.CompilerServices;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;

BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args);

public class Benchmarks
{
    static bool[] _values = Enumerable.Range(0, 256).Select(i => i % 2 == 0).ToArray();
    static char[] _output = new char[4096];

    [Benchmark]
    public void WriteBools()
    {
        Span<char> output = _output;
        foreach (var value in _values)
        {
            if (value.TryFormat(output, out int written))
                output = output.Slice(written);
            else
                throw new InvalidOperationException();
        }

        Consume(output);
    }

    [MethodImpl(MethodImplOptions.NoInlining)]
    void Consume(Span<char> _){}
}

(EgorBot will reply in this issue)

@EgorBot
Copy link
Owner Author

EgorBot commented Oct 5, 2024

Benchmark results on AzureIntel

BenchmarkDotNet v0.14.0, Ubuntu 22.04.5 LTS (Jammy Jellyfish)
Intel Xeon Platinum 8370C CPU 2.80GHz, 1 CPU, 8 logical and 4 physical cores
  Job-MANHPJ : .NET 10.0.0 (42.42.42.42424) using MonoVM, X64 X86Base
  Job-CQGKAO : .NET 10.0.0 (42.42.42.42424) using MonoVM, X64 X86Base
Method Toolchain Mean Error Ratio
WriteBools Main 5.764 μs 0.0208 μs 1.00
WriteBools PR 2.765 μs 0.0224 μs 0.48

BDN_Artifacts.zip

@EgorBot
Copy link
Owner Author

EgorBot commented Oct 5, 2024

cc @xtqqczze (logs)

@EgorBot
Copy link
Owner Author

EgorBot commented Oct 5, 2024

Benchmark results on AzureAmpere

BenchmarkDotNet v0.14.0, Ubuntu 22.04.5 LTS (Jammy Jellyfish)
AzureAmpere
  Job-NMRYVF : .NET 10.0.0 (42.42.42.42424) using MonoVM, Arm64 ArmBase
  Job-PJJUJF : .NET 10.0.0 (42.42.42.42424) using MonoVM, Arm64 ArmBase
Method Toolchain Mean Error Ratio
WriteBools Main 5.879 μs 0.0055 μs 1.00
WriteBools PR 3.130 μs 0.0218 μs 0.53

BDN_Artifacts.zip

@EgorBot
Copy link
Owner Author

EgorBot commented Oct 5, 2024

cc @xtqqczze (logs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant