Open AaronRobinsonMSFT opened 2 days ago
Tagging subscribers to this area: @mangod9 See info in area-owners.md if you want to be subscribed.
@EgorBot -intel -arm64 -perf
using System;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
BenchmarkRunner.Run<Bench>(args: args);
public class Bench
{
struct S;
[Benchmark]
public Type Nested() => typeof(S).DeclaringType;
[Benchmark]
public Type NotNested() => typeof(Bench).DeclaringType;
[Benchmark]
public Type RefElementType() => typeof(Bench[]).GetElementType();
[Benchmark]
public Type ValueElementType() => typeof(S[]).GetElementType();
}
@EgorBot -x64 -arm64 -profiler
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
public class Bench
{
struct S;
[Benchmark]
public Type Nested() => typeof(S).DeclaringType;
[Benchmark]
public Type NotNested() => typeof(Bench).DeclaringType;
[Benchmark]
public Type RefElementType() => typeof(Bench[]).GetElementType();
[Benchmark]
public Type ValueElementType() => typeof(S[]).GetElementType();
}
@AaronRobinsonMSFT the bot complained that -profiler
flag should be used when there are not more than 3 [Benchmark] attributes. I think I should improve error reporting 🙂
@EgorBot -x64 -arm64
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
public class Bench
{
struct S;
[Benchmark]
public Type Nested() => typeof(S).DeclaringType;
[Benchmark]
public Type NotNested() => typeof(Bench).DeclaringType;
[Benchmark]
public Type RefElementType() => typeof(Bench[]).GetElementType();
[Benchmark]
public Type ValueElementType() => typeof(S[]).GetElementType();
}
@EgorBot -x64 -arm64 -profiler
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
public class Bench
{
struct S;
[Benchmark]
public Type RefElementType() => typeof(Bench[]).GetElementType();
[Benchmark]
public Type ValueElementType() => typeof(S[]).GetElementType();
}
Convert
RuntimeMethodHandle.GetDeclaringType()
to managed and QCall. ConvertRuntimeTypeHandle.GetElementType()
to managed. Correct nullability in signature and usage. ConvertRuntimeTypeHandle.GetDeclaringType()
to managed and QCalls. RemoveGetRuntimeTypeHelper()
.