Open
Description
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)
Metadata
Metadata
Assignees
Labels
No labels