镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content
This repository was archived by the owner on Feb 23, 2026. It is now read-only.
This repository was archived by the owner on Feb 23, 2026. It is now read-only.

Benchmarks for #115134 (am11) #346

Open

Description

@EgorBot

Processing dotnet/runtime#115134 (comment) command:

Command

-amd -arm

using System.Reflection;
using BenchmarkDotNet.Attributes;

public class Bench
{
    public readonly int AReadonlyIntField = 42;

    [Benchmark]
    public int ReflectionFieldBoxing()
    {
        FieldInfo fieldInfo = typeof(Bench).GetTypeInfo().GetDeclaredField(nameof(AReadonlyIntField));
        Bench myInstance = new();

        object current = fieldInfo.GetValue(myInstance);

        fieldInfo.SetValue(myInstance, int.MinValue);

        return (int)current + (int)fieldInfo.GetValue(myInstance);
    }
}

(EgorBot will reply in this issue)

Activity

  1. EgorBot commented on Apr 29, 2025

    @EgorBot
    OwnerAuthor

    Benchmark results on linux_azure_genoa

    BenchmarkDotNet v0.14.0, Ubuntu 24.04.2 LTS (Noble Numbat)
    AMD EPYC 9V74, 1 CPU, 8 logical and 4 physical cores
      Job-JIJTSL : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
      Job-EIEAOQ : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
    
    Method Toolchain Mean Error Ratio
    ReflectionFieldBoxing Main 107.3 ns 0.12 ns 1.00
    ReflectionFieldBoxing PR 100.0 ns 0.08 ns 0.93

    BDN_Artifacts.zip

    cc @am11 (agent_logs.txt). EgorBot manual: link.

  2. EgorBot commented on Apr 29, 2025

    @EgorBot
    OwnerAuthor

    Benchmark results on linux_azure_cobalt100

    BenchmarkDotNet v0.14.0, Ubuntu 24.04.2 LTS (Noble Numbat)
    azure_cobalt100
      Job-YIEWJK : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
      Job-ZKUWHF : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
    
    Method Toolchain Mean Error Ratio
    ReflectionFieldBoxing Main 145.6 ns 0.23 ns 1.00
    ReflectionFieldBoxing PR 137.4 ns 0.23 ns 0.94

    BDN_Artifacts.zip

    cc @am11 (agent_logs.txt). EgorBot manual: link.

  3. am11 commented on Apr 29, 2025

    @am11

    @EgorBot -amd -arm -pr 115134

    using System.Reflection;
    using BenchmarkDotNet.Attributes;
    
    public class Bench
    {
        public readonly int AReadonlyIntField = 42;
    
        [Benchmark]
        public int ReflectionFieldBoxing()
        {
            FieldInfo fieldInfo = typeof(Bench).GetTypeInfo().GetDeclaredField(nameof(AReadonlyIntField));
            Bench myInstance = new();
    
            object current = fieldInfo.GetValue(myInstance);
    
            fieldInfo.SetValue(myInstance, int.MinValue);
    
            return (int)current + (int)fieldInfo.GetValue(myInstance);
        }
    }
  4. am11 commented on Apr 29, 2025

    @am11

    @EgorBot -amd -arm -pr 115134

    using System.Reflection;
    using BenchmarkDotNet.Attributes;
    
    [MemoryDiagnoser(false)]
    public class Bench
    {
        public readonly int AReadonlyIntField = 42;
    
        [Benchmark]
        public int ReflectionFieldBoxing()
        {
            FieldInfo fieldInfo = typeof(Bench).GetTypeInfo().GetDeclaredField(nameof(AReadonlyIntField));
            Bench myInstance = new();
    
            object current = fieldInfo.GetValue(myInstance);
    
            fieldInfo.SetValue(myInstance, int.MinValue);
    
            return (int)current + (int)fieldInfo.GetValue(myInstance);
        }
    }
  5. EgorBot commented on Apr 29, 2025

    @EgorBot
    OwnerAuthor

    ❌ Failed on AzureCobalt100: Job failed, see logs.

    cc @am11 (logs). EgorBot manual: link.

  6. EgorBot commented on Apr 29, 2025

    @EgorBot
    OwnerAuthor

    Benchmark results on linux_azure_genoa

    BenchmarkDotNet v0.14.0, Ubuntu 24.04.2 LTS (Noble Numbat)
    AMD EPYC 9V74, 1 CPU, 8 logical and 4 physical cores
      Job-SXBQCG : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
      Job-HWFTAV : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
    
    Method Toolchain Mean Error Ratio
    ReflectionFieldBoxing Main 109.5 ns 0.23 ns 1.00
    ReflectionFieldBoxing PR 100.1 ns 0.18 ns 0.91

    BDN_Artifacts.zip

    cc @am11 (agent_logs.txt). EgorBot manual: link.

  7. EgorBot commented on Apr 29, 2025

    @EgorBot
    OwnerAuthor

    Benchmark results on linux_azure_cobalt100

    BenchmarkDotNet v0.14.0, Ubuntu 24.04.2 LTS (Noble Numbat)
    azure_cobalt100
      Job-OSRXZM : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
      Job-LSCPBR : .NET 10.0.0 (42.42.42.42424), Arm64 RyuJIT AdvSIMD
    
    Method Toolchain Mean Error Ratio
    ReflectionFieldBoxing Main 146.3 ns 0.40 ns 1.00
    ReflectionFieldBoxing PR 137.5 ns 0.17 ns 0.94

    BDN_Artifacts.zip

    cc @am11 (agent_logs.txt). EgorBot manual: link.

  8. EgorBot commented on Apr 29, 2025

    @EgorBot
    OwnerAuthor

    Benchmark results on linux_azure_genoa

    BenchmarkDotNet v0.14.0, Ubuntu 24.04.2 LTS (Noble Numbat)
    AMD EPYC 9V74, 1 CPU, 8 logical and 4 physical cores
      Job-XKMLXN : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
      Job-FFICND : .NET 10.0.0 (42.42.42.42424), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
    
    Method Toolchain Mean Error Ratio Allocated Alloc Ratio
    ReflectionFieldBoxing Main 107.5 ns 0.34 ns 1.00 96 B 1.00
    ReflectionFieldBoxing PR 113.1 ns 0.08 ns 1.05 96 B 1.00

    BDN_Artifacts.zip

    cc @am11 (agent_logs.txt). EgorBot manual: link.

  9. am11 commented on Apr 29, 2025

    @am11

    @EgorBot -amd -arm -pr 115134

    using System.Reflection;
    using BenchmarkDotNet.Attributes;
    
    [MemoryDiagnoser(false)]
    public class Bench
    {
        public readonly int AReadonlyIntField = 42;
    
        [Benchmark]
        public int ReflectionFieldBoxing()
        {
            FieldInfo fieldInfo = typeof(Bench).GetTypeInfo().GetDeclaredField(nameof(AReadonlyIntField));
            Bench myInstance = new();
    
            object current = fieldInfo.GetValue(myInstance);
    
            fieldInfo.SetValue(myInstance, int.MinValue);
    
            return (int)current + (int)fieldInfo.GetValue(myInstance);
        }
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions